亚洲AV乱码一区二区三区女同,欧洲在线免费高清在线a,中文字幕丝袜四区,老少配老妇熟女中文高清

<s id="38axe"><nobr id="38axe"></nobr></s><abbr id="38axe"><u id="38axe"></u></abbr>

<sup id="38axe"></sup>
    <acronym id="38axe"></acronym>
  • <s id="38axe"><abbr id="38axe"><ins id="38axe"></ins></abbr></s>
    
    
        <s id="38axe"></s>

        數(shù)據(jù)庫工程師:SQL語法總結(jié)

        數(shù)據(jù)庫系統(tǒng)工程師 責任編輯:咖啡不甜 2015-10-17

        添加老師微信

        備考咨詢

        加我微信

        摘要:SID不對的話會拋出異常:java.sql.SQLException:Io異常:Connectionrefused(DEION=(TMP=)(VSNNUM=153092352)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)

            SQL語法總結(jié)

            1.按條件讀取字段,定義某個字段只取規(guī)定的幾個值,或一個值

            selectos.*fromblis_ordero,blis_orderserviceoswhereo.orderid=os.orderidando.ordertypeidnotin(4,8,10,11)ando.statusin(‘New','Accepted','Pending-apPRoval','Pending-effective','Pending-correction’)andsnp.status='Active'andb.entityid=1

            2.去掉重復(互異)的字段distinct

            selectdistinctop.name,op.fromblis_chargeactivationca,blis_orderparameteropwhereop.mastertype='charge'andca.chargeactivationid=op.masteridandca.parentcodelike'%NBRStorageCharge%'

            3.某個字段不可為null

            selectos.orderserviceid,os.orderofferid,o.ordertypeid,o.statusfromBlis_Ordero,Blis_Orderserviceoswhereo.orderid=os.orderidandos.orderofferidisnotnull

            4.刪除滿足某個條件的記錄

            deletefromblis_bstoffermigplanbsfwherebsf.keyid='110206'

            5.取name_a字段,放入字段別名name_b

            selectbsf.keyidsubcode,bsf.bstoffermigplanidfromblis_bstoffermigplanbsf

            這里取的是keyid字段,顯示的為subcode字段。

            6.connectionrollbackcommit

            rollback就是把在內(nèi)存中做的行為取消,不持久化到數(shù)據(jù)庫中,commit就是把內(nèi)存中做的行為持久化到數(shù)據(jù)庫中。

            7.在Oracle中使用Dual。Dual是Oracle一個特有的虛擬表,Oracle中很多系統(tǒng)的sequence(序列),sequence一般和表建立了一一對應關系,但是要編程插入的話,必須手工指定,比如增加條account數(shù)據(jù),相應的值插入SEQ_ACCOUNT.nextval,變量和函數(shù)都可以通過Dual中獲得

            S:selectgetdate();

            O:selectsysdatefromdual;

            selectSEQ_INTEGRATIONTASK.NEXTVALfromDUAL

            8.(PK)主鍵(PK)(fordatabase)

            9.排序(數(shù)字,字母由大到?。?/p>

            selectbsf.*fromblis_bstoffermigplanbsforderbybsf.ordertypeiddesc

            10.插入一條記錄

            insertintoblis_bstoffermigplan(bstoffermigplanid,entityid,keyid,subioncode,ordertypeid,type,templatecode,currencycode,exceptioncount,lastexception,att1,att2,att3,att4,att5,offercode,status,createdby,creationdate,lastmodifiedby,lastmodifieddate)values(seq_bstoffermigplan.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,sysdate,?,sysdate)

            11,更新一條記錄

            updateoffermigplan.db_table_namesetentityid=?,keyid=?,subioncode=?,ordertypeid=?,type=?,templatecode=?,currencycode=?,exceptioncount=?,lastexception=?,att1=?,att2=?,att3=?,att4=?,att5=?,offercode=?,status=?,createdby=?,lastmodifiedby=?,lastmodifieddate=sysdatewherebstoffermigplanid=?

            12.插入數(shù)據(jù)量比較大的類型clob

            13.查詢?nèi)掌?/p>

            下列兩條語句功能相同

            select*fromblis_accountaccwhereto_char(acc.lastmodifieddate,'YYYYMMDD‘)>'20050101'

            select*fromblis_accountaccwhereacc.lastmodifieddate>to_date('2005-01-01','yyyy-mm-dd’)

            14.找出根據(jù)某個字段中的值重復的記錄

            比如找出chargeactivationid有相同值的blis_usageaccess記錄

            select*fromblis_usageaccesswherechargeactivationidin(selectchargeactivationidfromblis_usageaccessgroupbychargeactivationidhavingcount(*)>1)

            USAGEACCESSIDCHARGEACTIVATIONIDSERVICEACCESSCODE

            292518148701AUDIO-BROADCAST@

            292517148701VOip@

            292516148701CALLIN-DID@

            292515148701CALLBACK-INTL@

            292512148701CALLIN@

            292513148701CALLIN-TOLLFREE@

            292514148701CALLBACK@

            292478147945AUDIO-BROADCAST@

            292477147945VOIP@

            292475147945CALLBACK-INTL@

            292476147945CALLIN-DID@

            292472147945CALLIN@

            15.通過查詢獲得某個字段的合計值,如果這個值位null將給出一個預設的默認值

            selectnvl(ob.bookingvalue,0)bookingvaluefromblis_ordero,blis_orderbookingobwhereo.orderid=ob.orderidando.orderid=125034andob.bookingtypeid=215andob.status='Active'

            這里關心nvl的用法,nvl(arg,value)代表如果前面的arg的值為null那么返回的值為后面的value

            16.知道一個column的名字,但不清楚它屬于哪張table時,可以使用

            select*fromuser_col_commentsuccwhereucc.column_name='column_name'

            比如:select*fromuser_col_commentsuccwhereucc.column_name='ORDERID'就會查出一系列有ORDERID字段的表。

            17.遍歷兩字段排列

            select(pf.offername||''||cur.name)offercodefromblis_packageofferpf,blis_currencycurwherecur.status='Active'andpf.status='Active'

            結(jié)果如下:

            offercode

            a1b1

            a1b2

            a2b1

            a2b2

            18.條件判斷

            casewhenpc.provisioningby='BPS'then'True'

            else'False'end

            selectsos.Sosorderserviceid,st.sosprovisionticketid,

            (casewhenpc.provisioningby='BPS'then'True'

            else'False'end)isConnector

            fromblis_sosprovisionticketst,blis_sosorderformsof,

            blis_sosorderservicesos,blis_packagecomponentpc

            wheresof.sosorderformid=sos.sosorderformid

            andsos.sosorderserviceid=st.sosorderserviceid

            andsos.status='Active'andst.status='Active'

            andpc.tagname(+)=st.servicetagandpc.provisioningby

            andsof.sosorderformid=104789

            19.pc.tagname(+)=st.servicetag

            當pc.tagname存在值,st.servicetag不存在值的話,記錄也可以檢索出來。

            20.讓表可以手工編輯

            selectrowid,st.*fromblis_sosprovisionticketstwherest.sosprovisionticketid=102508

            用classes12.zip還是會拋出classNotFoundException:oracle.jdbc.driver.OracleDriver,換用class12.jar就正常了,classes12.zip或class12.jar是JDBCoracle驅(qū)動類

            創(chuàng)建數(shù)據(jù)庫:

            查看所有表:select*fromdba_all_tables

            查看所有用戶:select*fromall_users

            查看所有DBA用戶:select*fromdba_users

            創(chuàng)建role:createroleBLIS_ADMIN_ROLE;

            創(chuàng)建新用戶:createuserusernameidentifiedbypassWord

            授予表空間使用權(quán):grantresourcetousername

            授予創(chuàng)建表權(quán)限:grantcreatetabletousername

            授予連接數(shù)據(jù)庫的權(quán)限:grantcreatesessiontousername

            查看所有表空間:select*fromdba_tablespaces

            把任何表授予某用戶:grantcreateanytabletoBLIS_ADMIN_ROLE;

            授予某用戶檢索功能:grantcreateanyindextoBLIS_ADMIN_ROLE;

            授予某用戶對某表有檢索,插入,更新,刪除功能:grantselect,insert,update,deleteonBLIS_ACCAGENCYCOMMISSIONtoBLIS_ADMIN_ROLE;

            導出數(shù)據(jù)庫:比如:expblis/blis@dblsfull=yfile=d:1.dmp

            連接ORACLE數(shù)據(jù)庫的字符串格式是

            jdbcracle:thin主機:端口:SID

            注意是SID而不是數(shù)據(jù)庫名

            SID不對的話會拋出異常:java.sql.SQLException:Io異常:Connectionrefused(DEION=(TMP=)(VSNNUM=153092352)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)

            更多資料請登錄希賽軟考網(wǎng)


        相關推薦:

              數(shù)據(jù)庫系統(tǒng)工程師該怎么發(fā)展?

              怎樣獲得數(shù)據(jù)庫系統(tǒng)工程師認證?

              數(shù)據(jù)庫系統(tǒng)工程師的基本要求與發(fā)展


        溫馨提示:因考試政策、內(nèi)容不斷變化與調(diào)整,本網(wǎng)站提供的以上信息僅供參考,如有異議,請考生以權(quán)威部門公布的內(nèi)容為準!

        軟考備考資料免費領取

        去領取

        !
        咨詢在線老師!