суббота, 16 марта 2013 г.

Как осуществить фильтрацию по строковым столбцам


SELECT *
FROM AdventureWorks2012.Production.Product
WHERE Color = 'Red'

SELECT *
FROM AdventureWorks2012.Production.Product
WHERE Color != 'Red'

SELECT *
FROM AdventureWorks2012.Production.Product
WHERE Name < 'b'

SELECT *
FROM AdventureWorks2012.Production.Product
WHERE Name < 'Chain'

SELECT *
FROM AdventureWorks2012.Production.Product
WHERE Name <= 'Chain'


SELECT *
FROM AdventureWorks2012.Production.Product
WHERE Name BETWEEN 'c' AND 'f'


SELECT *
FROM AdventureWorks2012.Production.Product
WHERE Color IN ('Red','Blue')