C
cx0731
Unregistered / Unconfirmed
GUEST, unregistred user!
这个在SQL SERVER数据库里面创建视图的sql语句有什么问题啊?老是报错“在关键字‘group’附近有语法错误”???<br>create view v_meetinginfo as<br>select ID, max(Pubdate) as MaxPubDate, max(ShowType) as ShowType from<br>((select ID, NoticeTitle as title, PubNoticeDate as PubDate, 0 as ShowType from Meetinginfo) union<br>(select ID, SummaryTitle as title, PubSummaryDate as PubDate, 1 as ShowType from Meetinginfo<br> where PubSummaryDate is not null))<br> group by ID order by MaxPubDate desc<br><br>已知 Meetinginfo 的表结构如下:<br>列名 数据类型 长度 允许空<br>ID numeric 5<br>noticetitle varchar 400 是<br>summarytitle varchar 400 是<br>PUBORGANID numeric 5 是<br>PUBNOTICEDATE datetime 8 是<br>JOINER text 16 是<br>NOTICE text 16 是<br>TOPIC text 16 是<br>SUMMARY text 16 是<br>PUBEMPID numeric 5 是<br>PUBSUMMARYDATE datetime 8 是