| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 220 人关注过本帖
标题:SQL语句出错
只看楼主 加入收藏
人王
Rank: 2
等 级:论坛游民
帖 子:20
专家分:22
注 册:2011-7-2
结帖率:25%
收藏
 问题点数:0 回复次数:0 
SQL语句出错
SQL = "SELECT [G-Title].[G-Number] as [G-Number],[Local],[G-Name],[ManagerSign],[Update-Time],[S-Date],[E-Date],[Locked],[BookingHeader].[Booking_Count]"
SQL = SQL & " FROM [G-Title] LEFT JOIN (SELECT [G_Number] as [G-Number],count([M_Number]) as [B_Count] from [bookingbody] group by [G_Number]) as [Booking] ON [G-Title].[G-Number] = [BookingBody].[G-Number]"
SQL = "SELECT [MainData].*,[MCount].[M_Count] FROM (" & SQL & ") as [MainData] LEFT JOIN (SELECT [G-Number],count([G-Number]) as [M_Count] FROM (SELECT [G-Number],[M_ID] FROM [GroupMembers] GROUP BY [G-Number],[M_ID]) GROUP BY [G-Number]) as [MCount] ON [MainData].[G-Number] = [MCount].[G-Number]"

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]在关键字 'GROUP' 附近有语法错误。
大家帮帮忙啊!
2012-04-11 09:56
快速回复:SQL语句出错
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019154 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved