Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Databases Programming Interviews:BtrieveClipperData ModelingData StructuresDatabase AdministrationDatabase Administrator (DBA)Database AnalystDatabase DeveloperDB DevelopmentEDI/Data Integration ExpertFirebirdHierarchicalIBM DB2InformixJava DatabaseMariaDBMicrosoft Access DeveloperMongoDBMS SQL ServerMySQL ProgrammingNetworkNoSQLObject RelationalPostgrePostgreSQLProgressRDBMSRelationalSQLSQL AdministratorSQL and PL/SQLSQL Notification ServicesSQL server 2008SSRSStored ProcedureSybaseTeradata
Copyright © 2018. All Rights Reserved
MS SQL Server Interview Question:
How To Select Some Specific Rows from a Table in MS SQL Server?
Submitted by: AdministratorIf 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 ggl_links WHERE url LIKE '%s%'
GO
id url notes counts created
102 globalguideline.com/sql NULL 0 2007-05-19
103 globalguideline.com/xslt NULL NULL 2007-05-19
SELECT * FROM ggl_links WHERE id < 100
GO
0 row
Submitted by: Administrator
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 ggl_links WHERE url LIKE '%s%'
GO
id url notes counts created
102 globalguideline.com/sql NULL 0 2007-05-19
103 globalguideline.com/xslt NULL NULL 2007-05-19
SELECT * FROM ggl_links WHERE id < 100
GO
0 row
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.