You are here: Re: T-SQL Problem « MsSQL Server « IT news, forums, messages
Re: T-SQL Problem

Posted by Tom Moreau on 03/21/06 15:03

That's different. You're looking at what's called Relational Division:

select
UserID
from
ENC_UserDefinedData
where
(
[ENC_UserDefinedData].[UserDefinedField] = 8
AND
[ENC_UserDefinedData].[Value] LIKE '%Picasso%'
)
OR
(
[ENC_UserDefinedData].[UserDefinedField] = 9
AND
[ENC_UserDefinedData].[Value] = '48'
)
group by
UserID
having
count (*) >= 2

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"Jose" <discussions@avandis.co.uk> wrote in message
news:1142932229.880694.305600@v46g2000cwv.googlegroups.com...
Thanks for your reply Tom.

I would like that all conditions are met - let me explain. In words I
would like "get me the users who answered "apple" for questions 5 AND
answered "red" for question 3". Each row in my table contains an answer
to a question.

Do you have any more suggestions?

Kind regards,
Jose

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация