sql中把乙個查詢結果當做乙個新表來查詢

2021-06-05 12:06:08 字數 703 閱讀 1123

sql中把乙個查詢結果當做乙個新表來查詢

2009-11-18 15:09

舉例:

1、select a.stk_c,b.name,cat_c3 from 

(select stk_c from stk_dtl where stk_qty>0 group by stk_c) a,stk_mas b where a.stk_c=b.stk_c

2、select * from 

(select sum(num_qnty4) as sumnum, num_linkid 

from rw_store_qunty 

group by num_linkid ) a

left join b on a.num_linkid =b.num_linkid 

where a.num_linkid = 1002

3、select a.realname,b.username from sa_member a,

(select username2 as username,is_agree from sa_memberfriend where username1='jhgjhg' union all select username1 as username,is_agree from sa_memberfriend where username2='jhgjhg') b where a.username=b.username

做乙個programmer,而不做乙個coder

programmer是程式的思考者,而coder只是乙個執行者 勞心者製人,勞力者制於人 如果專案不緊的情況下,應該從需求做起,最好能夠窮盡所有的需求,遇到與別人模組互動的情況,規定好與別人互動的介面。然後才是開始設計,抓住需求當中的名詞,想想是否設計成為類,然後根據測試用例,來設計框架結構,至少要...

乙個命令的操作結果當做另乙個命令的輸入

uname a linux virtual machine 5.3.0 61 generic 55 ubuntu smp fri jun 1911 16 34 utc 2020 x86 64 x86 64 x86 64 gnu linuxuname a可列印出機器名與系統核心版本等資訊,如果加上管道...

sql 利用游標遍歷乙個查詢結果

這裡有乙個單位表 unitt idname 1單位1 2單位2 有乙個評分專案表 itemt idname 1專案1 2專案2 有乙個單位得分表 scoret idunitid itemid score11 12022 15031 23042 260現在需要遍歷所有單位將他們的分數查詢出來,就用迴圈...