Simple MYSQL Select from 2 Tables -
i have 2 mysql tables, current table , archive table. archive table exact copy of current table , contains old records.
both tables contain advert_id column.
i want search both tables record advert_id equals value.
if doesnt exist in first, search second.
the way work doing 2 select statements, 1 first table , if record wasnt found select second table. how search both @ once?
try below.
select * current advert_id = 222 union select * archived advert_id = 333
Comments
Post a Comment