【正文】
Left Join 與 Right Join區(qū)別 //有重復(fù)只顯示一行系統(tǒng)管理員39。 from SCOTT.web_tbl_login as code, 39。 select SCOTT.web_tbl_login.LOGINID, NM39。 SCOTT.wdc_ts_code SCOTT.wdc_ts_code.DESCRIPTION, SCOTT.web_tbl_login.REALNAME, 或:select *,(select description from sr_department where code = (select top 1 code from web_tbl_login where userid =2)) as description from web_tbl_login where userid = 21兩 表疊加: select * from aaa where (select count(*) from bbb) = (select * from ccc)降序:order by aaa desc多表關(guān)聯(lián): select aa,bb from aaa where aa = (select cc from bbb) select aa,bb from aaa where aa in (select cc from bbb) ELSE serviceId END SELECT personId, CASE WHEN serviceId IS NULL THEN 39。 delete from info where not exists (select * from infobz where =)得到表中最小的未使用的ID號(hào) select , from a,b where = select , from table a, insert into b(a, b, c) select d,e,f from g。 //精妙語句復(fù)制表(創(chuàng)建): strSql+=Delete From SR_CxMain Where Cx_MainID=MaxId。select MaxId=(Select IsNull(Max(Cx_MainID),0)+1 From SR_CxMain)。 strSql=declare MaxId int。 UPDATE SR_BuiltItem INNER JOIN SR_SourceItem ON ( = ) AND ( = ) SET = [SR_SourceItem].[Description]。 FROM A004A001 INNER JOIN100000000039。 UPDATE A004A001 ) ON [PRIMARY] ( 或 PRIMARY KEY (id,……) ( 字段 is null建表及主鍵匹配字符串39。匹配字符串39。 create view myview as (select …)最右/最左一位 GROUP BY codeid SELECT codeid,