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.
| Author |
Topic |
|
gagani
Posting Yak Master
112 Posts |
Posted - 2012-08-29 : 06:04:00
|
| contractno processA processB101 Y N102 Y Y103 N N104 N YI want the output with all the contracts excluding when processA <>Nand processB <>N simultaneouslyThe output should becontractno processA processB101 Y N102 Y Y104 N Y |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2012-08-29 : 07:00:27
|
SELECT * FROM dbo.Table1 WHERE ProcessA <> 'N' AND ProcessB <> 'N' N 56°04'39.26"E 12°55'05.63" |
 |
|
|
gagani
Posting Yak Master
112 Posts |
Posted - 2012-08-29 : 07:26:26
|
| That query satisifies only the condition when both processes are 'Y'giving the output102 Y YBut I want the output satisfying three conditions:processA processBy ny yn ythe output should be101 Y N102 Y Y104 N Y |
 |
|
|
gagani
Posting Yak Master
112 Posts |
Posted - 2012-08-29 : 07:50:23
|
| My apologies, I didn't mention one more point, there could be repetition of contract numbers like for example,101 Y N101 Y Y101 N N101 N YThe output should be101 Y N101 Y Y101 N Y |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2012-08-29 : 08:26:12
|
You say you want this quote: I want the output with all the contracts excluding when processA <>Nand processB <>N simultaneously
which is what Peso gave you,but your desired output shows something else. Maybe thisSELECT *FROM yourTableWHERE ProcessA= 'Y' or ProcessB='Y'JimEveryday I learn something that somebody else already knew |
 |
|
|
|
|
|