如下:
select * from table1 where 工資>2500 and 工資<3000 //同上
select 姓名 from table1 where 性別="0" and 工資="4000"
select * from table1 where not 工資= 3200
select * from table1 order by 工資desc //將工資按照降序排列
select * from table1 order by 工資 asc //將工資按照升序排列
select * from table1 where year(出身日期)=1987 //查詢table1 中所有出身在1987的人select * from table1 where name like "%張" /"%張%" /"張%" //查詢1,首位字‘張’3,尾位字‘張’2,模糊查詢
select * from table1 order by money desc //查詢表1按照工資的降序排列表1 (升序為asc)
select * from table1 where brithday is null //查詢表1 中出身日期為空的人
SQL語言,是結構化查詢語言(Structured Query Language)的簡稱。
SQL語言是一種資料庫查詢和程式設計語言,用於存取資料以及查詢、更新和管理關係資料庫系統;同時也是資料庫指令碼檔案的副檔名。
SQL語言是高階的非過程化程式語言,允許使用者在高層資料結構上工作。它不要求使用者指定對資料的存放方法,也不需要使用者瞭解具體的資料存放方式,所以具有完全不同底層結構的不同資料庫系統可以使用相同的結構化查詢語言作為資料輸入與管理的介面。SQL語言語句可以巢狀,這使他具有極大的靈活性和強大的功能。
如下:
select * from table1 where 工資>2500 and 工資<3000 //同上
select 姓名 from table1 where 性別="0" and 工資="4000"
select * from table1 where not 工資= 3200
select * from table1 order by 工資desc //將工資按照降序排列
select * from table1 order by 工資 asc //將工資按照升序排列
select * from table1 where year(出身日期)=1987 //查詢table1 中所有出身在1987的人select * from table1 where name like "%張" /"%張%" /"張%" //查詢1,首位字‘張’3,尾位字‘張’2,模糊查詢
select * from table1 order by money desc //查詢表1按照工資的降序排列表1 (升序為asc)
select * from table1 where brithday is null //查詢表1 中出身日期為空的人
SQL語言,是結構化查詢語言(Structured Query Language)的簡稱。
SQL語言是一種資料庫查詢和程式設計語言,用於存取資料以及查詢、更新和管理關係資料庫系統;同時也是資料庫指令碼檔案的副檔名。
SQL語言是高階的非過程化程式語言,允許使用者在高層資料結構上工作。它不要求使用者指定對資料的存放方法,也不需要使用者瞭解具體的資料存放方式,所以具有完全不同底層結構的不同資料庫系統可以使用相同的結構化查詢語言作為資料輸入與管理的介面。SQL語言語句可以巢狀,這使他具有極大的靈活性和強大的功能。