Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can do subscription between two SELECT set?

SELECT field1
FROM tbl1
WHERE conditionsx

...?

SELECT field2
FROM tbl2
WHERE conditionsy

I Want return same below↓ What is superscription between two SELECT results.

enter image description here

like image 495
parmer_110 Avatar asked Jul 10 '26 15:07

parmer_110


1 Answers

You can use the INTERSECT operator:

SELECT field1 FROM tbl1 WHERE conditionsx
INTERSECT
SELECT field2 FROM tbl2 WHERE conditionsy
like image 67
forpas Avatar answered Jul 12 '26 08:07

forpas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!