Saturday, 15 May 2010

sql server - select rows from table and check if condition at column in sql -


I want to examine some rows from the table and the if-else status of each line Check

Tab: Report

COLUMNS: sl.no , count , Total_count , call

sample data:

  sl.no count total_count call --------- - - --------- ----------- ----------- 1 2 6 4 2 2 5 5 3 4 9 3  

Here I have to check whether the condition

  if total_count> 6 Select 'Y' and select 'N'.  

I get the correct answer for a single line if it is a multiple line then it can not check all, it's in my table Only checks for the last line.

Use the expression

  SELECT *, in case Kul_snkya & Gt; 6 Then 'yes' report from 'n' end  

No comments:

Post a Comment