August 4, 2009 at 9:53 am
hi,
i have two tables1 and table2
table1 contains.. name,adderess,emailid ,code as the columns and
table2 contains.. id, rewardid
so now i need to pull the table values where table1.code matches with table2.rewardid( like table1.code = table2.rewardid)
please give me the query for this.
August 4, 2009 at 10:03 am
Check out joins in BOL. You need an INNER JOIN.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
August 4, 2009 at 10:23 am
i tried this..
SELECT a.rewardCode , b.FirstName
FROM tblCodes aJOIN tbloffer b on (a.RewardCode = b.code) WHERE b.code != null
but it didnt work for me.. could you please help me.
August 4, 2009 at 10:23 am
i tried this..
SELECT a.rewardCode , b.FirstName
FROM tblCodes a JOIN tbloffer b on (a.RewardCode = b.code) WHERE b.code != null
but it didnt work for me.. could you please help me
August 4, 2009 at 11:25 am
Perhaps if you posted actual table structures so your example matches your original explanation we might be able to help. Please read the first article linked in my signature so you can help us help you.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
August 4, 2009 at 11:29 am
hi,
it worked for me. i was not comparing the right columns to match the data.
Thank you for you help.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply