Query same table twice

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

Do you need twice the number of records? Or do you want just one recordset where sale_manager = 2 and rent_manager = 1?

[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

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.