首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

想问一下,这个SQL语句如何不行

2012-01-07 
想问一下,这个SQL语句怎么不行!以下是SQL语句,为什么这样写不行,谢谢!selectcount(*)asnumfrom(select*fro

想问一下,这个SQL语句怎么不行!
以下是SQL语句,为什么这样写不行,谢谢!
select   count(*)   as   num   from   (select   *   from   orderlist   where   date   between   '2007-6-15   0:01:01 '   and   '2007-7-15   23:59:59 ')   where   country= 'China '

[解决办法]
select count(*) as num from (select * from orderlist where date between '2007-6-15 0:01:01 ' and '2007-7-15 23:59:59 ') a where country= 'China '
在(SELECT * FROM ... 59:59 ') 后加个别名 如a 应该就行了

热点排行