我写了一段select代码,在sqlserver中可以的,可是我用在ORACLE中就不行报错了,请问下是什么错啊,谢谢
selectaa.METER_NO,aa.CURR_T0,aa.READ_DATE,(aa.CURR_T0-(selecta.CURR_T0FROMDAY_READ_DA...
select aa.METER_NO,aa.CURR_T0,aa.READ_DATE,(aa.CURR_T0-(select a.CURR_T0 FROM DAY_READ_DATA AS a where a.READ_DATE=(select c.LAST_READ_DATE FROM DAY_READ_TIME AS c where aa.READ_DATE=c.READ_DATE and aa.METER_NO=a.METER_NO))),aa.DYNAMETER from DAY_READ_DATA AS aa
报的是:ORA-00936: missing expression 展开
报的是:ORA-00936: missing expression 展开
1个回答
展开全部
怎么那么费劲嘞???嵌套那么多,一起就可以了呀~
SELECT aa.METER_NO,
aa.CURR_T0,
aa.READ_DATE,
(aa.CURR_T0-(SELECT a.CURR_T0
FROM DAY_READ_DATA AS a,
DAY_READ_TIME AS c
WHERE aa.METER_NO=a.METER_NO
and c.READ_DATE=aa.READ_DATE
AND a.READ_DATE=c.LAST_READ_DATE)),
aa.DYNAMETER
FROM DAY_READ_DATA AS aa ;
SELECT aa.METER_NO,
aa.CURR_T0,
aa.READ_DATE,
(aa.CURR_T0-(SELECT a.CURR_T0
FROM DAY_READ_DATA AS a,
DAY_READ_TIME AS c
WHERE aa.METER_NO=a.METER_NO
and c.READ_DATE=aa.READ_DATE
AND a.READ_DATE=c.LAST_READ_DATE)),
aa.DYNAMETER
FROM DAY_READ_DATA AS aa ;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询