首页 > 学技术 > 技术网文 > DB2 > 正文

[精彩] 一个小问题


来源 chinaunix.net 酷勤网整理

我想实现类似select 0,* from table :oops: name的功能,db2中该如何写这样的sql语句



 CCBZZP 回复于:2003-07-10 11:22:04

具体說說實現那种功能?


 bigbigbigant 回复于:2003-07-10 12:22:31

就是把表里的字段全部取出来,外加一个常量字段(SYBASE中的SQL语句select 0,* from tblname)


 CCBZZP 回复于:2003-07-10 12:30:43

SELECT  0,COL1,COL2,COL3,,,, FROM TABLE
可以的


 足球小子 回复于:2003-07-10 12:31:09

只有把所有的字段名写全,而不用*代替,就可以了。如:
select 0, deptname from org


 bigbigbigant 回复于:2003-07-10 12:48:45

我的表里字段太多了,痛苦


 ddmmdd 回复于:2003-07-10 17:19:21

没用的删!设计的问题。
反正是常量,在外面赋值不可以吗?


 永远是新手 回复于:2003-07-11 16:21:34

select 0,a.* from t1 a


 mymm 回复于:2003-07-12 14:40:02

高! :em27:


 CCBZZP 回复于:2003-07-12 15:10:40

select 0,a.*  from DB2ADMIN.BSEMPMS a


 bigbigbigant 回复于:2003-07-14 18:27:22

thk,解决了




原文链接:http://bbs.chinaunix.net/viewthread.php?tid=111237
转载请注明作者名及原文出处



收藏本页到: