Reputation: 13
i have a table I am using for referrals. The table has 3 columns: ID, FriendCode, and Referred
. I want to
Referred
from the row where the ID = currentUser
refereeFriendCode
,
ID | Referred | FriendCod
1 | 1 | 100
2 | 0 | 200
I want to select 1 from referred column and 2 from ID column, and what I have is an ID of 1(current user) and FriendCode 200.
How do I go about this?
Thanks in advance!
Upvotes: 0
Views: 1954
Reputation: 69440
Is:
select ID from tablename where ID=1
union
select ID from tablename where FriendCode=100
what you want?
Upvotes: 1