知识在于积累(.NET之路……)

导航

实用的SQL语句集

有两个表t1和t2,如下所示:

表t1:select * from t1

表t2:select * from t2

如果SQL语句为:
select 0 as cid,'未指定' as name UNION ALL select cid,name from t1

则得如下数据:

如果SQL语句为:
select *,'' as col1 from t1
select *,'a' as col1 from t1
select *,2 as col1 from t1

将分别得到如下三种数据:

posted on 2010-04-16 17:35  汤尼  阅读(108)  评论(0)    收藏  举报