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)
 Query_question...

Author  Topic 

Agenteusa
Starting Member

11 Posts

Posted - 2007-12-05 : 14:24:26

Hi everyone,

Let me introduce my problem:

I have a table called let's say [something.state] which handles the state of warranties. I have a column in this table called state of the type integer and name like '1' - Out of warranty, '2' - under negotiation, '3' - Valid, so on...

Now this table relates to one called [something] in which I can have a client that has 1 warranty for 1 product 'Valid' and another 'In Negotiation'. This for just one client identified by the same ID number.

How can I select a client that has at least one warranty 'Valid' but does not have one 'In negotiation'...?

Example:

Client1 has 2 warranties.

Client1 - 'Valid'
Client1 - 'In negotiation'

This one wouldn't show up on the listing since it has already one warranty 'in negotiation'..

I know this might be tricky( so I think).. but could someone help me?

Thanks in advance

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-12-05 : 14:35:33
See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=93712



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -