yueyue, I have fallen in love with you for

2011-02-09, 01:18:25 PM

SQL中的union使用方法

Posted on 2011-08-31 15:15  张超的博客  阅读(374)  评论(0)    收藏  举报

Union运算符,可以将多个select查询结果集并成为一个结果集合。

案例赏析:    Sqltxt = " Select Property_Num,isnull(Replace(Property_Num,' ',''),'')+'-'+isnull(Replace(Property_Name,' ',''),'') as Property_Name from T_Cod_Property where Property_Type='ControlLevel' " +
                 " union " +
                 " Select '0' Property_Num,'全部' as Property_Name from T_Cod_Property" +
                 " Order by Property_Num ";

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3