varadharajan p.r Rajan varadharajan p.r Rajan - 5 months ago 15
MySQL Question

how to write query for A(table) union B(table) intersect C(table) in mysql

Iam try to do this

select Barcode from ITList union select Barcode from Equipment_list
intersect select Barcode from Scanneditem

Answer

You can use Exists for this

Select * from (select Barcode from ITList union select Barcode from   Equipment_list) as t 
where exists (select Barcode from Scanneditem where Scanneditem.Barcode = t.Barcode)
Comments