Well perhaps this is a dialect issue, but doing a query like that in SQL Server generates an error. So, no, it isn't OK.
For example:
SELECT *
FROM RXS_CT_GENERIC
WHERE (CONTENTID, REVISIONID) IN ((335, 1), (336, 1))
causes SQL Server to complain about incorrect syntax near ','. This also happens with no values, so it looks like it doesn't like (CONTENTID,REVISIONID)
I was looking through the documentation for SQL Server and didn't see any "IN" operator example that did any sort of composite in clause. I was able to code around my problem by using a set of OR'd conditions. I don't know if there's an efficiency advantage of one over the other.
|