0

My original query is:

SELECT * from test where ID BETWEEN 10 AND 100
INTERSECT
SELECT * from test where MARKS=10

But, INTERSECT is not working in MySQL I am querying from the same table and INNER JOIN is not working.

Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390

1 Answers1

0

This looks like it should work fine.

SELECT * from test where ID BETWEEN 10 AND 100
INTERSECT
SELECT * from test where MARKS=10

However you can verify it against this, which is a better way to do the same thing.

SELECT * from test where ID BETWEEN 10 AND 100
                     and  MARKS=10

If the both give you the same then they are both working and there is something about your data you don't understand.

Karl Kieninger
  • 8,841
  • 2
  • 33
  • 49