varadharajan p.r Rajan varadharajan p.r Rajan - 1 year ago 100
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 Source

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)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download