adspace


How to select true false based on column value in sql server?

Answer Posted / Narendra Pal Singh

In SQL Server, you can use the CASE statement to create conditional logic that returns a true or false (1 or 0). Here's an example:nn```sqlnSELECT ColumnNamenFROM YourTablenWHERE CASE WHEN ColumnValue = 'desired_value' THEN 1 ELSE 0 END = 1;```

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql server query analyzer?

1128


How can we solve concurrency problems?

1122


What is standby servers? Explain types of standby servers.

1079


How to rebuild the master database?

1166


How to enter binary string literals in ms sql server?

1244


what is the Ticketing tool used in Wipro technologies at Bangalore...???

8230


How to provide default values to function parameters?

1258


Can we do dml on views?

1038


What are the different SQL Server Versions you have worked on?

1079


Is it possible to have clustered index on separate drive from original table location?

1040


When should you use an instead of trigger?

1052


explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration

1133


What are the different types of subquery?

1235


what is spatial nonclustered index

1058


What are wait types?

1249