举个例子:
SELECT name, address, phone FROM USER;
生成表格
name | address | phone ... | ... | ...
如何使用此表生成另一个查询?
例如:
SELECT count(address) FROM (SELECT name, address, phone, from user);
我知道这不是最好的例子,但有没有办法做到这一点?
使用相同的语法,但为派生表提供别名
SELECT count(subadd.address) FROM (SELECT name, address, phone, from user) as subadd;