1

I don't have an example for this but I was just wondering if something like this is valid in any situation:

SELECT somefield
FROM sometable
WHERE something1 IN (SELECT somefield2 FROM sometable2)
  AND something2 IN (SELECT somefield3 FROM sometable3)
Mureinik
  • 297,002
  • 52
  • 306
  • 350
kale
  • 113
  • 1
  • 4

2 Answers2

1

In a word - yes. You can have as many conditions as you want in a where clause, regardless of whether they have in conditions or not.

Mureinik
  • 297,002
  • 52
  • 306
  • 350
0

Yes. Your syntax needs to be fixed though:

SELECT somefield
FROM sometable
WHERE something1 IN (SELECT somefield2 FROM sometable2)                        
AND something2 IN (SELECT somefield3 FROM sometable3)
Bohemian
  • 412,405
  • 93
  • 575
  • 722