sql取小於
發布時間: 2023-09-21 22:16:42
㈠ 如何用sql語句查出學生表成績小於60為不及格60-80為良好80-90為優秀
select name,case when 成績<60 then 不及格 when 成績>=60 and 成績<80 then 良好 when 成績>=0 and 成績<90 then 優秀 end as 成績情況 ,from 表名。
注意,在輸入sql語句的時候,要在英文環境下輸入。否則可能會出現代碼不識別。
㈡ sql語句查詢表中一個欄位的值小於另一個欄位的值怎麼寫
直接寫就行啊,比如 where dnum<alldnum
這樣語句就會一行一行的比較,當這一行的dnum值小於這一行的alldnum值時就會輸出。
熱點內容