亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

SQL Server基礎--T-SQL語句

難度入門
時長 1小時37分
學習人數
綜合評分9.57
350人評價 查看評價
9.8 內容實用
9.4 簡潔易懂
9.5 邏輯清晰
  • select...(用逗號隔開)from... select * from *表示所有的列 select Top 100 * from 所有列的前100行 oder by desc倒序 asc正序 oder by...desc 可以同時按照多個column排列 oder by 2 按照選擇的第二個排列 isnull函數 isnull(color,'')用空格代替空值NULL as關鍵字:給表列起名 +關鍵字:連接“列”和“字符串” 注意‘’中的空格 算術表達式 + - * / select rate*40*52 as...from... round(rate*40*52,1) 1表示保留小數點后1位 0則不保留
    查看全部
  • table中的各種屬性說明
    查看全部
  • 兩種時間格式,后面月日年 between and >= 和 < :不包含某一天
    查看全部
  • order by 2:select屬性列表中的第二個屬性 isnull(Color,'') as Color: 用空格代替空值 'The list price for ' + ProductNumber + ' is $ ' + convert(varchar, ListPrice) + '.' as [Description]
    查看全部
  • isnull(color,"")
    查看全部
  • 記憶名詞
    查看全部
  • 講的很好的,為什么后面沒有更新了?
    查看全部
  • 聲音杠杠的
    查看全部
  • 聲音好聽
    查看全部
  • 啥時候出新的啊
    查看全部
  • 記住這些名詞的意思 以后幫助很大
    查看全部
  • 重新學習數據庫~
    查看全部
  • --count:統計結果數 select count(SalesPersonID) from Sales.SalesOrderHeader where SalesPersonID is not null --distinct:獨一無二的 select distinct(SalesPersonID) from Sales.SalesOrderHeader where SalesPersonID is not null 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 Having與Where的區別 where 子句的作用是在對查詢結果進行分組前,將不符合where條件的行去掉,即在分組之前過濾數據,where條件中不能包含聚組函數,使用where條件過濾出特定的行。 having 子句的作用是篩選滿足條件的組,即在分組之后過濾數據,條件中經常包含聚組函數,使用having 條件過濾出特定的組,也可以使用多個分組標準進行分組
    查看全部
  • 在什么之間:between ... and ... 例: select SalesOrderID,OrderDate,SalesPersonID,TotalDue as TotalSales from Sales.SalesOrderHeader where Orderdate between '2005-08-01' and '1/1/2006' --通配符%,模糊搜索 select * from Production.Product where name like '%Mountain%' --通配符_,單個字符 select * from Production.Product where name like '_ountain%' --in:匹配多個字段,即集合 select * from Production.Product where color in ('red','white','black') --not in : 不等于某個字段 select * from Production.Product where class not in ('H','L') --查詢null值 select * from Production.Product where size isnull --查詢非null select * from Production.Product where size is not null
    查看全部
  • use AdventureWorks--選擇數據庫 select Top 10 * from Production.Product--輸出前10個數據 --根據listprice和Name進行降序排序 select ProductID, Name, ProductNumber, Color, Size, ListPrice from Production.Product order by listprice desc,Name desc --根據輸出的第二個列進行排序,即Name select ProductID, Name, ProductNumber, Color, Size, ListPrice from Production.Product order by 2 --isnull:輸出時代替null值,例: select ProductID, Name, ProductNumber, isnull(Color,''), isnull(Size,''), ListPrice from Production.Product --as:別名 select ProductID, Name, ProductNumber, isnull(Color,'') as Color, isnull(Size,'') as Size123, --using an alias ListPrice from Production.Product --使用”+“連接字符 select ProductID, Name as ProductName, 'The list price for '+ProductNumber+'is $ '+convert(varchar,ListPrice)+'.' as Description from Production.Product --算術計算,round(rate*40*52,1),1代表保留一位小數,0則不保留 select BusinessEntityID, rate*40*52 as AnnualSalary, round(rate*40*52,1) as AnnualSalary round(rate*40*52,0) as AnnualSalary from HumanResources.EmployeePayHistory
    查看全部

舉報

0/150
提交
取消
課程須知
本教程特別為零基礎的學員而設計,無需有任何計算機背景和專業。老師會循序漸進,深入淺出地對數據庫以及相關的TSQL查詢語言進行介紹講解。
老師告訴你能學到什么?
1、目前市場上流行的幾大數據庫巨頭及其產品簡介 2、詳細的微軟數據庫軟件安裝步驟和基本功能介紹 3、關系型數據庫的概念介紹和實體模型 4、經典TSQL查詢句式 5、如何進行正倒序排列、使用別名、數學符號 6、如何使用條件句式,如何處理空值,如何使用分組函數

微信掃碼,參與3人拼團

微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

友情提示:

您好,此課程屬于遷移課程,您已購買該課程,無需重復購買,感謝您對慕課網的支持!