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 |
|
omega1983
Starting Member
40 Posts |
Posted - 2009-08-27 : 15:22:20
|
| I have a one to many scenario and need assistanceOne ID can have many Attributesif ID has attribute 6025 I want to eliminate that ID in the VIEW or proceedure. Here is a sanpshotID Attribute1233 60251233 60331233 6034In this example because ID 1233 has 6025 I want to eliminate the entire ID 1233 not just ID 1233 with attribute 6025. I eventually want to bring this into a report using crystal reports or microsoft report services. Any ideas. Is this a procedure candidate or can this be done with a simple view. |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-08-27 : 15:30:47
|
| can't you say in your SELECT statement:Where ID <> 1233Be One with the OptimizerTG |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-08-27 : 15:47:38
|
| SELECT ID,AttributeFROM yourTableWHERE ID NOT IN(select id from yourTable where attribute = 6025)?Jim |
 |
|
|
|
|
|