February 23, 2009 at 4:09 am
Hi
I'm facing a problem in generating the required data. Following are two queries with the result.
Select
M.MemberID,
B.BillingId
FROM
dbo.Member M, dbo.Billing B
WHERE B.MEMBERID = M.MEMBERID AND
M.MemberId = 66835
select MemberId, MemberEventId from MemberEvent Me where Me.MemberId = 66835
MemberID BillingId
----------- -----------
66835 268926
66835 268927
66835 268928
(3 row(s) affected)
MemberId MemberEventId
----------- -------------
66835 278265
66835 278266
66835 278267
66835 278272
66835 278274
66835 278273
(6 row(s) affected)
I want data form these two tables but with no repetition of MemberEventId i.e. It should return only 6 rows with three columns i.e. memberid, billingId and MemberEventId.
Please help
February 23, 2009 at 8:03 am
The problem is, which BillingID do you want to use for which MemberEventID.
I'm not sure this problem has a solution for the given data.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 23, 2009 at 8:13 am
I agree with Jeff.
There doesn't appear to be a relation between memberEventID and BillingId. If you want to display the results (memberId, billingID, memberEventID), and return only 6 rows, then there would have to be a correlation between billingID and memberEventID.
It may help if you explain what you are trying to achieve at a higher level, rather than focusing in on this query.
Regards, Jim C
February 24, 2009 at 3:24 am
Thanks 4 ur comments now I’m assured that it’ll not work in this way.
Regards Kamran :hehe:
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply