Skip to content

Instantly share code, notes, and snippets.

@ndthanh
Created December 22, 2016 09:00
Show Gist options
  • Save ndthanh/6a9c557bb21c294e2779b7ef1806fbd2 to your computer and use it in GitHub Desktop.
Save ndthanh/6a9c557bb21c294e2779b7ef1806fbd2 to your computer and use it in GitHub Desktop.
#lấy toàn bộ các cột báo cáo
SELECT * FROM [A1:U42000]
SELECT [ORDER DATE], [ORDER QUANTITY], [SALES] FROM [A1:U42000]
SELECT [Order ID],[Order Date],[Order Quantity],[Order Priority] ,[Customer Name] FROM [A1:U42000] WHERE [Order Priority] = "High"
SELECT [Order ID],[Order Date],[Order Quantity],[Customer Name] FROM [A1:U42000] WHERE [Order Priority] = "High" AND [Customer Name] = "Annie Cyprus"
SELECT [Order ID],[Order Date],[Order Quantity],[Customer Name],[Ship Mode] FROM [A1:U42000] WHERE [Order Priority] = "High" AND [Ship Mode] LIKE "%Air"
SELECT [Order Quantity],[Sales],[Profit],[Sales]*0.1 as [Thue 10%] FROM [A1:U42000]
SELECT [Customer Name],[Region],[Order Priority] FROM [A1:U42000] WHERE [Order Priority] LIKE "High"
SELECT [Customer Name],[Region],[Order Priority],[Ship Mode] FROM [A1:U42000] WHERE [Order Priority] LIKE "High" AND [Ship Mode] LIKE "%AIR"
#Trong ADO SQL, dấu % sử dụng kèm với toán tử LIKE là dấu *
SELECT MAX([Profit]) as [Max Profit cua Carlos] FROM [A1:U42000] WHERE [Customer Name] LIKE "Carlos%"
SELECT [Order Date],[Customer Name] FROM [A1:U42000] WHERE [Order Date]>=#17/06/2011# ORDER BY [Order Date] DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment