I have following data in my table.
I want to extract ProductId which has this criteria,
FieldValue = 1.0 and FieldValue = 'Y' and FieldValue = 'N'
This is not possible using following query
select * from MyTable
WHERE (FieldId = 50 AND (FieldValue BETWEEN '1.0' AND '1.0'))
AND (FieldId = 55 AND FieldValue = 'Y')
AND (FieldId = 60 AND FieldValue = 'N')
and I can't use query like this. This also fetch ProductId 103 and 104.
select * from MyTable
WHERE (FieldId = 50 AND (FieldValue BETWEEN '1.0' AND '1.0'))
OR (FieldId = 55 AND FieldValue = 'Y')
OR (FieldId = 60 AND FieldValue = 'N')
I don't know ProductId in advance. In-fact I want to extract ProductId using FieldValue criteria. I CAN'T USE ProductId in my where clause because I don't know. Only I know Is the fieldValue and FieldId.
Thanks for help!