-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02.ORDER BY_WHERE_OR_AND_IN.sql
More file actions
71 lines (54 loc) · 1.03 KB
/
02.ORDER BY_WHERE_OR_AND_IN.sql
File metadata and controls
71 lines (54 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
-- ORDENANDO E FILTRANDO DADOS
--ORDER BY
--WHERE..
--OR AND IN
--ORDER BY
SELECT TOP (10)
ProductName as Produto,
UnitCost AS Preço,
Weight AS Peso
FROM
DimProduct
ORDER BY
UnitCost DESC, Weight DESC
--WHERE..LIKE
--WHERE FILTRANDO NUMERO
SELECT
ProductName,
UnitPrice
FROM
DimProduct
WHERE
UnitPrice >=3000
--WHERE FILTRANDO TEXTO
SELECT
ProductName,
UnitPrice,
BrandName
FROM
DimProduct
WHERE
BrandName='Contoso'
--WHERE FILTRANDO DATA
SELECT*FROM
DimCustomer
WHERE BirthDate >='1966-04-08'
ORDER BY BirthDate
--WHERE ...AND , OR e NOT
SELECT * FROM DimProduct
WHERE
BrandName = 'Contoso' and
ColorName = 'Red' and
UnitPrice >=2000
SELECT * FROM DimProduct
WHERE
BrandName ='Litware' or
BrandName='Fabrikam' or
BrandName='Black'
SELECT * FROM DimSalesTerritory
WHERE SalesTerritoryGroup = 'Europe' and
Not SalesTerritoryCountry = 'Italy'
SELECT * FROM DimProduct
WHERE (ColorName ='Black' or ColorName = 'Red') and BrandName = 'Fabrikam'
SELECT * FROM DimProduct
WHERE ColorName IN ( 'Silver', 'Blue')