oracleÊý¾Ý¿âÖйØÓÚnullÅÅÐòµÄÎÊÌâ_OracleÊý¾Ý¿â_ºÚ¿Í·ÀÏßÍø°²·þÎñÆ÷ά»¤»ùµØ--Powered by WWW.RONGSEN.COM.CN

oracleÊý¾Ý¿âÖйØÓÚnullÅÅÐòµÄÎÊÌâ

×÷ÕߣººÚ¿Í·ÀÏßÍø°²Oracleά»¤»ùµØ À´Ô´£ººÚ¿Í·ÀÏßÍø°²Oracleά»¤»ùµØ ä¯ÀÀ´ÎÊý£º0

±¾Æª¹Ø¼ü´Ê£ºOracleÊý¾Ý¿âOracleÊý¾Ý¿â
ºÚ¿Í·ÀÏßÍø°²ÍøѶ£º¡¡¡¡ÎÊÌâÃèÊö£º ¡¡¡¡ÔÚ´¦ÀíÒ»°ãµÄÊý¾Ý¼Ç¼ÖУ¬¶ÔÓÚÊý×ÖÀàÐ͵Ä×ֶΣ¬ÔÚoracleµÄÅÅÐòÖУ¬Ä¬ÈÏ°ÑnullÖµ×öΪ´óÓÚÈκÎÊý×ÖµÄÀàÐÍ£¬µ±È»¶ÔÓÚvarchar2ÀàÐ͵Ä×ֶΣ¬Ä¬ÈÏÒ²ÊǸô¦Àí·½Ê½£¬µ«ÊÇ¿Í»§ÒªÇó...

¡¡¡¡ÎÊÌâÃèÊö£º

¡¡¡¡ÔÚ´¦ÀíÒ»°ãµÄÊý¾Ý¼Ç¼ÖУ¬¶ÔÓÚÊý×ÖÀàÐ͵Ä×ֶΣ¬ÔÚoracleµÄÅÅÐòÖУ¬Ä¬ÈÏ°ÑnullÖµ×öΪ´óÓÚÈκÎÊý×ÖµÄÀàÐÍ£¬µ±È»¶ÔÓÚvarchar2ÀàÐ͵Ä×ֶΣ¬Ä¬ÈÏÒ²ÊǸô¦Àí·½Ê½£¬µ«ÊÇ¿Í»§ÒªÇóÅÅÐòµÄ¹ý³ÌÖУ¬ÐèÒª°ÑnullµÄ×Ö¶ÎĬÈÏÅÅÔÚÇ°±ß£¨´ÓС£­£­>´ó£©¡£Ò»°ãµÄorder by xxxx£¬ÎÞ·¨½â¾ö¡£

¡¡¡¡ÎÊÌâ½â¾ö£º

¡¡¡¡·½°¸1£º

¡¡¡¡¿ÉÒÔʹÓø´ÔÓµÄʹÓÃsql£º

select * from
(select a.*,rownum as my_sys_rownum from (
select deptid,nvl(BDZNAME,' '),nvl(VOLLEVEL,'0'),ZBRL,nvl(ZBTS, '0'),
nvl(FZR,'0'),nvl(DEPTIDDES,' '),nvl(TEL,' '),nvl(RUNSTATEDES,' '),
nvl(ADDRESS,' '),BDZID from V_BDZ where¡¡rownum<2000
and ZBRL is null
) a
union
select b.*,rownum+(select count(*) from (
select deptid,nvl(BDZNAME,' '),nvl(VOLLEVEL,'0'),ZBRL,nvl(ZBTS, '0'),
nvl(FZR,'0'),nvl(DEPTIDDES,' '),nvl(TEL,' '),nvl(RUNSTATEDES,' '),
nvl(ADDRESS,' '),BDZID from V_BDZ where¡¡rownum<2000
and ZBRL is null
)) as my_sys_rownum from (
select deptid,nvl(BDZNAME,' '),nvl(VOLLEVEL,'0'),ZBRL,
nvl(ZBTS, '0'),nvl(FZR,'0'),
nvl(DEPTIDDES,' '),nvl(TEL,' '),nvl(RUNSTATEDES,' '),
nvl(ADDRESS,' '),BDZID from V_BDZ where¡¡rownum<2000
and ZBRL is not null order by ZBRL
) b
)
¡¡¡¡¡¡order by my_sys_rownum desc
¡¡¡¡·½°¸2£º

¡¡¡¡¿ÉÒÔÀûÓÃoracleÖпÉÒÔ¶Ôorder byÖжԱȽÏ×Ö¶Î×öÉèÖõķ½Ê½À´ÊµÏÖ£º

¡¡¡¡È磺¡¡¡­¡­order by nvl( aaa,'-1')

    ºÚ¿Í·ÀÏßÍø°²·þÎñÆ÷ά»¤·½°¸±¾ÆªÁ¬½Ó£ºhttp://www.rongsen.com.cn/show-12403-1.html
Íøվά»¤½Ì³Ì¸üÐÂʱ¼ä:2012-03-23 00:40:28  ¡¾´òÓ¡´ËÒ³¡¿  ¡¾¹Ø±Õ¡¿
ÎÒÒªÉêÇë±¾Õ¾£ºNµã | ºÚ¿Í·ÀÏß¹ÙÍø |  
רҵ·þÎñÆ÷ά»¤¼°Íøվά»¤ÊÖ¹¤°²È«´î½¨»·¾³£¬ÍøÕ¾°²È«¼Ó¹Ì·þÎñ¡£ºÚ¿Í·ÀÏßÍø°²·þÎñÆ÷ά»¤»ùµØÕÐÉ̽øÐÐÖУ¡QQ:29769479

footer  footer  footer  footer