-
table的基本框架查看全部
-
關系型數據庫的概念查看全部
-
自己新建ER圖查看全部
-
數據庫的第一印象查看全部
-
1,where的條件語句; 2,%,_,的模糊通配符; 3,字符串要用單引號:‘abc123’; 4,is in和is not in; 5,and和or。查看全部
-
開源——指代碼是公開的,免費的。查看全部
-
數據庫巨頭,最后兩個公開源代碼查看全部
-
表的行列名查看全部
-
locathose/. 都表示本機上的SQL Server查看全部
-
select from where group by having order by查看全部
-
----The classical T-SQL query!!! select SalesPersonID,OrderDate,Max(TotalDue) as MaximumTotalSales from [Sales].[SalesOrderHeader] where SalesPersonID is not null and OrderDate >='2007/1/1' group by SalesPersonID,OrderDate having Max(TotalDue)>150000 order by OrderDate desc查看全部
-
count 計算行數 distinct 不重復列出所有情況 select count(aaa) from... where aaa is not null select distinct(aaa) from... where aaa is not null select count(distinct(aaa)) from... where aaa is not null Avg(),Min(),Max(),Sum() group by select aaa,Max(...) as ... from... group by aaa having Max(...)>15000 Having與Where的區別 where 子句的作用是在對查詢結果進行分組前,將不符合where條件的行去掉,即在分組之前過濾數據,where條件中不能包含聚組函數,使用where條件過濾出特定的行。 having 子句的作用是篩選滿足條件的組,即在分組之后過濾數據,條件中經常包含聚組函數,使用having 條件過濾出特定的組,也可以使用多個分組標準進行分組查看全部
-
where...=,>,<,>=,<=,<>只能接int型 如果是string型要加‘’<br> 可以用and或or并列<br> between...and...<br> (表示時間兩種方式:年-月-日;月/日/年)<br> 通配符 模糊查詢<br> % where name like'%mountain%' %表示可有可無任何字符串<br> _ where name like '_ountain%'<br> _表示這個不知道是什么字符 in或not in<br> where color in('red','white','black')<br> in表示含有 where class not in('H')等同于<>'H"<br>not in表示不含有 is null或is not null<br>是空或不是空 where size is (not) null查看全部
-
0.選擇若干行代碼按F5可執行被選中的代碼,或者execute<br> 1.select top 100 表示搜索前100行的信息,select*盡量少用<br> 2.order by可以出現多個字段,默認為asc升序,desc降序;<br> order by 2表示從select中的第二列按照默認排序<br> 3.isnull(行名,'') 目的是使值為null的元組在查詢結果中以空白顯示<br> 4.3中無變量名,as關鍵字作別名: A as B :將A列名重新命名為B輸出到查詢結果中<br> 5. + 關鍵字將列與字符串連接起來,例如:A + "is" + B<br> 6. convert(type,變量) 7.可以加入運算,比如round(a*10,1)表示小數點后四舍五入保留一位查看全部
-
use語句 use [...(用的DB)] go(可有可無) 選中use語句后,F5或execute執行查看全部
舉報
0/150
提交
取消