每一个派生表必须有它自己的别名
select count(*) from (select t.a from test t group by t.a)
解决办法:
select count(*) from (select t.a from test t group by t.a)[color=red]c[/color]
select count(*) from (select t.a from test t group by t.a)
解决办法:
select count(*) from (select t.a from test t group by t.a)[color=red]c[/color]
本文解决了使用派生表时必须为其指定别名的问题。通过为派生表添加别名,可以成功执行 SQL 语句并获取正确的结果集。
3874

被折叠的 条评论
为什么被折叠?



