How can i query same table twice that i can have records twice from same table. For example my table has property records having sale_manager= 1 and rent_manager=2 and table structure is like: id, sale_manager, rent_manager1, address
I want to pick up all the records having rent_manager=1 from property table in addition to sale_manager=2. In this case same records should be picked up twice having rent_manager=1 and sale_manager=2
[quote=“Henson4004, post:1, topic:103561, full:true”]I want to pick up all the records having rent_manager=1 from property table in addition to sale_manager=2. In this case same records should be picked up twice having rent_manager=1 and sale_manager=2
[/quote]
SELECT id
, sale_manager
, rent_manager
, address
FROM daTable
WHERE rent_manager = 1
UNION ALL -- this is the trick to pick them up twice
SELECT id
, sale_manager
, rent_manager
, address
FROM daTable
WHERE sale_manager = 2