關於SQL高階查詢

2021-04-15 08:05:11 字數 472 閱讀 8046

關於sql高階查詢~

if request("btype_id")<>""  then  sql=sql&" btype_id="+request("btype_id")+" and"

if request("stype_id")<>""  then sql=sql&" stype_id="+request("stype_id")+" and"

'if request("tname")<>""  then sql=sql&" tname='"+request("tname")+"' "

if right(sql,5)="where" then sql=left(sql,clng(len(sql))-3)'解決所有引數為空

if right(sql,3)="and" then sql=left(sql,clng(len(sql))-3) '去掉引數的and

sql=sql&" order by productid desc"

SQL高階查詢

1建立乙個儲存過程,當工資大於8000的,工資減一成,否則加一成工資 2建立乙個函式,輸入學生學號,返回成績 student id,name,score 3查詢員工的工資,當工資大於2000時,顯示該工資 但工資低於2000,則加200元工資,然後再輸出 4求1 2 i,一直加到總和 6000,並求...

SQL高階查詢

案例1 查詢學生表中比 微冷的雨 小的學員資訊 姓名,位址 轉化成找出出生日期比 微冷的雨 大的日期 select from student 別人要什麼,我們給什麼 select from student where birthday select birthday from student whe...

sql高階語句查詢

例如 1.連線法 select a.b.from t2 mz sfdj a join t2 mz sfdjmx b on a.djid b.djid where a.ssje 5000 2.用連線來進行修改表裡記錄 update a set a.zy b.zy from t2 mz sfdj a i...