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
 Comparing Data from same Table

Author  Topic 

kshahborr99
Starting Member

2 Posts

Posted - 2012-09-06 : 22:12:55
Hi,

I have a table that looks like :

Fruit Status State City
Orange A NJ Edison
Orange T NJ hudson
Orange A IL Chicago
Orange I MA Boston

I would like to compare based on "Fruit" and match the status.

Only match if any line has staus "A" and than compare that line with other lines.

If a mismatch to display it.

So the result should be :

Orange NJ Edison A NJ hudson T MA Boston I


Thanks a bunch in advance

Thanks

Mike Jackson
Starting Member

37 Posts

Posted - 2012-09-07 : 08:33:54
and how did you eliminate...

Orange A IL Chicago

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-09-08 : 17:21:42
your current output doesnt make sense with explanation. is it that you dont want duplicate A status records and take only first one?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -