How do you select 2 rows from the same table in MySQL, with different conditions for each? -
i have table using referrals. table has 3 columns: id, friendcode, , referred
. want
- select
referred
row id =currentuser
- id row friendcode =
refereefriendcode
, - i want one query.
id | referred | friendcod 1 | 1 | 100 2 | 0 | 200
i want select 1 referred column , 2 id column, , have id of 1(current user) , friendcode 200.
how go this?
thanks in advance!
is:
select id tablename id=1 union select id tablename friendcode=100
what want?
Comments
Post a Comment