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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 VIEW or Proceedure to Hide All Records

Author  Topic 

omega1983
Starting Member

40 Posts

Posted - 2009-08-27 : 15:22:20
I have a one to many scenario and need assistance
One ID can have many Attributes
if ID has attribute 6025 I want to eliminate that ID in the VIEW or proceedure. Here is a sanpshot
ID Attribute
1233 6025
1233 6033
1233 6034
In 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 <> 1233

Be One with the Optimizer
TG
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-08-27 : 15:47:38
SELECT ID,Attribute
FROM yourTable
WHERE ID NOT IN
(select id from yourTable where attribute = 6025)?

Jim
Go to Top of Page
   

- Advertisement -