How can I create two aliases for a table containing a ,
separator in MySQL?
For example:
SELECT b.*,a.* FROM `tbl_users` a,b where a.id=b.parent_id.
How can I create two aliases for a table containing a ,
separator in MySQL?
For example:
SELECT b.*,a.* FROM `tbl_users` a,b where a.id=b.parent_id.
Looks like you are doing some self join and you can do as
select
a.*,b.* from tbl_users a
left join tbl_users b on a.id=b.parent_id
If you only want matching records then make it an inner join
instead of left join