|
Posted by Tom Moreau on 03/21/06 02:37
UserDefinedField cannot be simultaneously 8 and 9. Therefore, you'll get no
rows. However, if you want *either* of the two pairs of criteria, then use:
SELECT
*
FROM
UserDefinedData
WHERE
(
[ENC_UserDefinedData].[UserDefinedField] = 8
AND
[ENC_UserDefinedData].[Value] LIKE '%Picasso%'
)
OR
(
[ENC_UserDefinedData].[UserDefinedField] = 9
AND
[ENC_UserDefinedData].[Value] = '48'
(
--
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:1142900337.913053.182560@e56g2000cwe.googlegroups.com...
Hi All,
Sorry if this seems incredibly basic but what is the syntax to solve
this query. I have a table (ENC_UserDefinedData) with 4 columns, ID,
UserID, UserDefinedField and Value. I want to select all the UserIDs
that match this criteria:
[ENC_UserDefinedData].[UserDefinedField] = 8
AND
[ENC_UserDefinedData].[Value] LIKE '%Picasso%'
AND
[ENC_UserDefinedData].[UserDefinedField] = 9
AND
[ENC_UserDefinedData].[Value] = '48'
Thanks in advance,
Jose
Navigation:
[Reply to this message]
|