Collections:
Selecting Some Specific Rows from a Table in SQL Server
How To Select Some Specific Rows from a Table in SQL Server?
✍: FYIcenter.com
If you don't want select all rows from a table, you can specify a WHERE clause to tell the query to return only the rows that meets the condition defined in the WHERE clause. The WHERE clause condition is a normal Boolean expression. If any data from the table needs to be used in the Boolean expression, column names should be used to represent the table data.
The first select statement below only returns rows that have url names containing the letter "a". The second select statement returns no rows, because the WHERE clause results FALSE for all rows in the table.
SELECT * FROM fyi_links WHERE url LIKE '%a%' GO id url notes counts created 102 dba.fyicenter.com NULL 0 2007-05-19 103 sqa.fyicenter.com NULL NULL 2007-05-19 SELECT * FROM fyi_links WHERE id < 100 GO 0 row
⇒ Adding More Test Data for Query Statements in SQL Server
⇐ Selecting Some Specific Columns from a Table in SQL Server
⇑ Using SELECT Statements and GROUP BY Clauses in SQL Server
2016-10-26, 1778🔥, 0💬
Popular Posts:
How To Insert New Line Characters into Strings in SQL Server Transact-SQL? If you want to break a st...
How To Drop an Index in Oracle? If you don't need an existing index any more, you should delete it w...
Why I Can Not Enter 0.001 Second in DATETIME values in SQL Server Transact-SQL? If you enter millise...
What is dba.FYIcenter.com Website about? dba.FYIcenter.com is a Website for DBAs (database administr...
How To Format DATETIME Values to Strings with the CONVERT() Function in SQL Server Transact-SQL? SQL...