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

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -