View Single Post
Old 07-03-2012, 04:10 PM   PM User | #2
Keleth
Senior Coder

 
Join Date: Jun 2008
Location: New Jersey
Posts: 2,354
Thanks: 45
Thanked 247 Times in 244 Posts
Keleth is on a distinguished road
Not sure what you mean by "Most of them 3 & 4 are equal" and "Only want to if they are not equal"... these seem to be contradictory statements.

It seems you want the latter, so you'd want to add AND NORMAL_STATE != CURRENT_STATE before the ORDER BY.

Since you only have one table, you don't need the table reference before the folumn in the WHERE and order by columns.
Keleth is offline   Reply With Quote