一个很郁闷的问题!SQL语句中where后老不加空格!!!
IQ250 2006-03-16 02:51:43 我写的一条SQL如下:
(便于观看,我格式段行写了)
Select '10cm深度地温' as Odate1,Odate,avg(Gdata1) as Gdata1 from ( select (datename(yyyy,Odate)+'.'+datename(mm,Odate)) AS Odate,Gdata1 from WGData,OPlace where OPlace.Oplacecode=WGData.Opcode and Odate between '2004' and '2005' and Gcode='17') AS R1 group By Odate
union
Select '20cm深度地温' as Odate1,Odate,avg(Gdata1) as Gdata1 from ( select (datename(yyyy,Odate)+'.'+datename(mm,Odate)) AS Odate,Gdata1 from WGData,OPlace where OPlace.Oplacecode=WGData.Opcode and Odate between '2004' and '2005' and Gcode='18') AS R1 group By Odate order by Odate
可是调试的结果老是把第二个where 和后面的OPlace.Oplacecode=WGData.Opcode连在一起了!!!
中间我在程序里加了空格,但是调试出来的就不加空格,晕死了,谁知道为什么啊???