我的目标是,以“降序”顺序打印查询结果。但问题是,具有 NULL 值的行位于列表顶部。如果 order by 是降序,如何将空行放在底部?
select mysubcat.subcat
, mysubcat.subcatid as subcat_id
, (select SUM(myad.PAGEVIEW)
from myad
where MYAD.CREATEDDATE between '01-JUL-13 02.00.49.000000000 PM' and '13-JUL-13 02.00.49.000000000 PM'
AND MYAD.status = 1
and MYAD.mobileapp IS NULL
and myad.subcatid = mysubcat.subcatid )as web_views
from mysubcat
order by web_views desc;
样本结果是这样的
SUBCAT_ID WEB_VIEWS
Swimming Lessons 56 (null)
Medical Services 17 (null)
Mobile Phones & Tablets 39 6519
Home Furnishing & Renovation 109 4519
顺序是降序的,我只想把空值的行放在打印结果的底部,那怎么办?