Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Filter the values column wise

Author  Topic 

thambi2010
Starting Member

1 Post

Posted - 2010-10-12 : 17:52:20
Hi ,

value1 Count_value1 Value2 Count_val2 value3 count_val3
OK 0 OK 0 ~C 300
OK 0 OK 0 OK 0
~A 1276 ~B 1276 ~C 300
~A 1276 ~B 1276 ~C 300
~A 1276 ~B 1276 ~C 300

From above records, I want to take print result as below...

value1 Count_value1 Value2 Count_val2 value3 count_val3
~A 1276 ~B 1276 ~C 300


above result I wanted to have...

that means i need to ignore OK value and its count value(0) in each column.... I am thinking to filter using ~ operator .. but not getting clue...can you someone guide me


Regards,
Thambi




pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-10-13 : 03:30:54
Something to start with.

Select distinct value1, Count_value1, Value2, Count_val2, value3 ,count_val3 from yourtable
where value1 not in ('OK')

or
where value1 <>'OK'
Go to Top of Page
   

- Advertisement -