-
select (類) ,Max(類)as 別名 from (查詢表) where (類) is not null group by (類) **Max前必須把前面所有的類放在這里 order by (類) 順序排列查看全部
-
select Avg(類) as 別名:平均數(shù) ,Min(類) as 別名:最小數(shù) ,Max(類) as 別名:最大數(shù) ,Sum(類) as 別名:總和 from (查詢表)查看全部
-
select count(查詢類) from (查詢表) where is not null ::count 查詢這樣的數(shù)據(jù)一共有多少條 select distinct(查詢類) from (查詢表) where is not null ::distinct 查詢這樣獨一無二的數(shù)據(jù) select count(distinct(查詢類)) from (查詢表) where is not null ::count+distinct 查詢這樣獨一無二的數(shù)據(jù)一共有多少條查看全部
-
select * from 查詢表 where 類 in ("類所包含的項","類所包含的項","類所包含的項") select * from 查詢表 where 類 not in('類所不包含的項','類所不包含的項') select * from 查詢表 where 類 is null ::表示查詢這個類所有為 null 的 select * from 查詢表 where 類 is not null ::表示查詢這個類所有不為 null 的 select * from 查詢表 where 類:類的所指定項 or 類:類的所指定項 或 select * from 查詢表 where 類:類的所指定項 and 類:類的所指定項 和 擴展 select * from 查詢表 where (誰 or 誰) and (誰 and s誰)嵌套使用查看全部
-
wildcard:通配符 select * from (查詢表) where 類別 like '%123%' %123% :所有只要包含123的字符 %123 :所有結尾含有123的字符 123% :所有開頭含有123的字符查看全部
-
select (查詢類) from (要查詢的表) where ID(int:整數(shù)型)使用 < > = >= <= select (查詢類) from (要查詢的表) where Number="so43589" (string:字符型) :特值某個字符“” where 語句中可使用 and誰和誰 or誰或者誰查看全部
-
select ( ID, (rate+5)*40*52 as 別名 ) from (要查詢的表 ) (rate+5)*40*52 :四則運算法 括號里面優(yōu)先計算查看全部
-
var rate = 每小時工資 ; 價格/小時*40小時/周*52周/年= 年薪; 別名就是年薪 select (ID,rate*40*52 as 別名 ,round(rate*40*52,1) as 別名 ,round(rate*40*52,0) as 別名 ) from (要查詢的表) 1 表示小數(shù)點后一位 : 12.10 0 表示小數(shù)點后0 進位:12.00查看全部
-
select (要查詢的類 ‘字符串’+ 類名(表頭標題名)) from (要查詢的表) ::表示字符串和表內容 連接查看全部
-
select (要查詢的類(表頭名) isnull(Color,"") as Color, ::表示isnull設置color顯示為空 現(xiàn)用 as 關鍵字給為空的color 起別名 為color ) isnull(Size,"") as 別名, from (要查詢的表)查看全部
-
select (要查詢的類 name , isnull(Color,""):表示Color里面包含 null的顯示為 “”空 ) from (要查詢的表 )查看全部
-
select (要查詢的類 producyId,name) from (要查詢的表) order by (2 數(shù)字表示查詢類的第二項) 正序排列查看全部
-
select (要查詢的類:name,listprice) from (要查詢的表) order by (指定類 listprice) desc (指定類 name)查看全部
-
select (要查詢的類:Listprice)from (要查詢的表) order by (指定某一類項:Listprice ) desc desc ==descending order;倒序排列 asc ==ascending order ;正序排列查看全部
-
select (所需要查詢的類型如:ID,name,ProductNumber,Color,Size 等等) from (所要查詢的表)查看全部
舉報
0/150
提交
取消