标题:请教一个问题!!!大家帮帮忙啊
只看楼主
人王
Rank: 2
等 级:论坛游民
帖 子:20
专家分:22
注 册:2011-7-2
结帖率:25%
 问题点数:0 回复次数:0 
请教一个问题!!!大家帮帮忙啊
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][ODBC SQL Server Driver][SQL Server]在关键字 'GROUP' 附近有语法错误。
怎么改啊?
2012-04-12 16:45



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




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

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