想问一下在Oracle中当查询出为空时我想显示为其它值要怎么做?
就是当某个字段查询为空值,我不想它为空,想直接在查询结果中显示为其它值,要怎么写?比如,下面这个语句:SELECTq.route_name,q.route_date,q....
就是当某个字段查询为空值,我不想它为空,想直接在查询结果中显示为其它值,要怎么写?
比如,下面这个语句:
SELECT q.route_name, q.route_date, q.route_price, t.countnum, t.start_time
FROM quota q left outer join v_panicinfo_num t on
q.route_date = t.start_time
where q.route_name = '三亚湾亚太国际会议中心暨三亚海航度假酒店豪华山景房双飞五日自由行' order by q.route_date
我想要t.countnum查询为空时显示为0要怎么做? 展开
比如,下面这个语句:
SELECT q.route_name, q.route_date, q.route_price, t.countnum, t.start_time
FROM quota q left outer join v_panicinfo_num t on
q.route_date = t.start_time
where q.route_name = '三亚湾亚太国际会议中心暨三亚海航度假酒店豪华山景房双飞五日自由行' order by q.route_date
我想要t.countnum查询为空时显示为0要怎么做? 展开
展开全部
SELECT q.route_name, q.route_date, q.route_price, NVL(t.countnum,0), t.start_time
FROM quota q left outer join v_panicinfo_num t on
q.route_date = t.start_time
where q.route_name = '三亚湾亚太国际会议中心暨三亚海航度假酒店豪华山景房双飞五日自由行' order by q.route_date
FROM quota q left outer join v_panicinfo_num t on
q.route_date = t.start_time
where q.route_name = '三亚湾亚太国际会议中心暨三亚海航度假酒店豪华山景房双飞五日自由行' order by q.route_date
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询