标题: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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-365555-1-1.html




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

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