教你若何看懂SQL Server查詢籌劃。本站提示廣大學習愛好者:(教你若何看懂SQL Server查詢籌劃)文章只能為提供參考,不一定能成為您想要的結果。以下是教你若何看懂SQL Server查詢籌劃正文
/*LYXXB(陵寢信息表)
lymc(甲方),dz(通訊地址),dh(接洽德律風)
*/
SELECT lymc,dz,dh FROM lyxxb
/*去失落回車(\b)*/
update lyxxb set dz=replace(dz,chr(13),'')
/*去失落換行(\n)*/
update lyxxb set dz=replace(dz,chr(10),'')
/*去失落回車(\b)*/
update lyxxb set dh=replace(dh,chr(13),'')
/*去失落換行(\n)*/
update lyxxb set dh=replace(dh,chr(10),'')
/*YWDJB(營業掛號表)
gxrxm(y乙方),azfsdm(種別),mwflmc(地位),lxdz(家庭地址),ksrq(開端日期),jsrq(停止日期),sfzh(身份證號),ssje(實收金額),rq(解決日期)
*/
/*生態*/
SELECT gxrxm,azfsmc,mwflmc,to_char(ksrq,'yyyy') as years1,to_char(ksrq,'mm') as months1,to_char(ksrq,'dd') as days1,to_char(jsrq,'yyyy') as years2,to_char(jsrq,'mm') as months2,to_char(jsrq,'dd') as days2,ssje,money_to_chinese(ssje) as dx FROM ywdjb WHERE djh='02x1995052119950140'
SELECT gxrxm,lxdz,lxdh,sfzh,czyxm,to_char(rq,'yyyy') as years,to_char(rq,'mm') as months,to_char(rq,'dd') as days FROM ywdjb WHERE djh='02x1995052119950140'
/*墓位*/
SELECT gxrxm,mxmc,mwflmc,to_char(ksrq,'yyyy') as years1,to_char(ksrq,'mm') as months1,to_char(ksrq,'dd') as days1,to_char(jsrq,'yyyy') as years2,to_char(jsrq,'mm') as months2,to_char(jsrq,'dd') as days2,ssje,money_to_chinese(ssje) as dx FROM ywdjb WHERE djh='20130201164043'
SELECT s.SCMXTJFL1,y.gxrxm,y.mxmc,y.mwflmc,to_char(y.ksrq,'yyyy') as years1,to_char(y.ksrq,'mm') as months1,to_char(y.ksrq,'dd') as days1,to_char(y.jsrq,'yyyy') as years2,to_char(y.jsrq,'mm') as months2,to_char(y.jsrq,'dd') as days2,y.ssje,money_to_chinese(y.ssje) as dx FROM ywdjb y inner join spmldm s on y.mxdm=s.spmldm where djh='20130201164043'
select SCMXTJFL1 from spmldm where spmldm='305'
select * from ywdjb where mxdm='305'
/*續租*/
SELECT mwflmc,mxmc,mj,dabh FROM qtywb WHERE djh='032005032120050374' and ywdjh='yw200505090028'
SELECT WRXM FROM wrxxb_str WHERE djh='032005032120050374'
select wrxm from wrxxb_str where djh='02x1995040619950095'
SELECT mwflmc,mxmc,mj,dabh FROM qtywb WHERE djh='02x1995040619950095'
/*xx*/
SELECT w.wrxm,q.sfzh,q.lxdz,q.czyxm,q.lxdh,to_char(q.rq,'yyyy-mm-dd') as sj,q.mwflmc,q.mxmc,q.mj,q.dabh,to_char(q.ksrq,'yyyy') as years1,to_char(q.ksrq,'mm') as months1,to_char(q.ksrq,'dd') as days1,to_char(q.jsrq,'yyyy') as years2,to_char(q.jsrq,'mm') as months2,to_char(q.jsrq,'dd') as days2 FROM qtywb q INNER JOIN wrxxb_str w ON q.djh=w.djh WHERE q.djh='032005032120050374' and q.ywdjh='yw200505090028'
SELECT lymc FROM lyxxb
/*WRXXB(亡人信息表)
wrxm(亡人姓名),xb(性別),nl(年紀),mz(平易近族)
*/
SELECT wrxm,x.xbmc,nl,mz FROM wrxxb w INNER JOIN xbxx x ON w.xb=x.xbdm WHERE djh='02x1995052119950140'
select to_char(rq,'yyyy') as years,to_char(rq,'mm') as months,to_char(rq,'dd') as days from ywdjb
select * from xbxx
select * FROM wrxxb
select ksrq,jsrq from ywdjb
select to_char(ksrq,'yyyy') as years1,to_char(ksrq,'mm') as months1,to_char(ksrq,'dd') as days1,to_char(jsrq,'yyyy') as years2,to_char(jsrq,'mm') as months2,to_char(jsrq,'dd') as days2 from ywdjb