资源描述:
《天蝎机柜服务器技术规范2.5版+++课件.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、天蝎机柜服务器技术规范2.5版ObjectivesAftercompletingthislesson,youshouldbeabletodothefollowing:LimittherowsthatareretrievedbyaquerySorttherowsthatareretrievedbyaqueryUseampersandsubstitutioniniSQL*PlustorestrictandsortoutputatruntimeLimitingRowsUsingaSelection“retrie
2、veallemployeesindepartment90”EMPLOYEES…LimitingtheRowsThatAreSelectedRestricttherowsthatarereturnedbyusingtheWHEREclause:TheWHEREclausefollowstheFROMclause.SELECT*
3、{[DISTINCT]column
4、expression[alias],...}FROMtable[WHEREcondition(s)];SELECTemployee_id,las
5、t_name,job_id,department_idFROMemployeesWHEREdepartment_id=90;UsingtheWHEREClauseSELECTlast_name,job_id,department_idFROMemployeesWHERElast_name='Whalen';CharacterStringsandDatesCharacterstringsanddatevaluesareenclosedbysinglequotationmarks.Charactervalue
6、sarecase-sensitive,anddatevaluesareformat-sensitive.ThedefaultdateformatisDD-MON-RR.ComparisonConditionsOperatorMeaning=Equalto>Greaterthan>=GreaterthanorequaltoNotequaltoBETWEEN...AND...Betweentwovalues(inclusive)IN(set)Mat
7、chanyofalistofvaluesLIKEMatchacharacterpatternISNULLIsanullvalueSELECTlast_name,salaryFROMemployeesWHEREsalary<=3000;UsingComparisonConditionsSELECTlast_name,salaryFROMemployeesWHEREsalaryBETWEEN2500AND3500;UsingtheBETWEENConditionUsetheBETWEENconditionto
8、displayrowsbasedonarangeofvalues:LowerlimitUpperlimitSELECTemployee_id,last_name,salary,manager_idFROMemployeesWHEREmanager_idIN(100,101,201);UsingtheINConditionUsetheINmembershipconditiontotestforvaluesinalist:SELECTfirst_nameFROMemployeesWHEREfirst_name
9、LIKE'S%';UsingtheLIKEConditionUsetheLIKEconditiontoperformwildcardsearchesofvalidsearchstringvalues.Searchconditionscancontaineitherliteralcharactersornumbers:%denoteszeroormanycharacters._denotesonecharacter.UsingtheLIKEConditionYoucancombinepattern-matc
10、hingcharacters:YoucanusetheESCAPEidentifiertosearchfortheactual%and_symbols.SELECTlast_nameFROMemployeesWHERElast_nameLIKE'_o%';SELECTlast_name,manager_idFROMemployeesWHEREmanager_idISNULL;UsingtheNULLConditionsTest