《SQL必知必會》學習筆記 第四課 過濾資料

2021-10-06 02:06:29 字數 823 閱讀 3803

select id,age,city

from inf

where age>20

order by 2 ,3 desc;

注意:

(1)where子句同樣在from子句之後給出

(2)order by 子句同樣放在最後

select id,age,city

from inf

where age>20

order by 2 ,3 desc;

select id,age,city

from inf

where age<>20

order by 2 ,3 desc;

select id,age,city

from inf

where age!=20

order by 2 ,3 desc;

列出所有年齡不是20的資訊

select id,age,city

from inf

where age between 16 and 30;

注意:age 加單引號會報錯,單引號用來限定字串,用於與字串匹配。

建立表時,我們指定其中的列不包含值時,稱其包含空值null。

select id,age,gender

from inf

where gender is null;

注意:運用where is null子句確定

《SQL必知必會》筆記四 18 19課

4.1 檢視 mysql 從版本 5 起開始支援檢視 理解檢視 在下例中,檢索其他產品 或多個產品 的相同資料,必須修改最後的where 子句。select cust name,cust contact from customers,orders,orderitems where customers...

C 學習第四課 串

字串 兩種形式,一種是c模式,一種是c 模式 c模式 char a 6 char a hello 幾種函式 strcpy str1,str2 將str2的內容複製到str1上 strcat str1,str2 將str2連到str1的後面 strlen str1 求取字串str1的長度 strcmp...

孫鑫VC第四課學習筆記

孫鑫 vc第四課學習筆記 訊息對映 1.vc中乙個點的資料結構 cpoint 2.訊息響應函式 如乙個on 響應函式,在標頭檔案中在注釋巨集之間有函式原型的宣告 afx msg 其中afx 表明是訊息響應函式的宣告。在原檔案中,有乙個 begin message map 和end message m...