By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,852 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Help in mysql query

P: 15
Hi,
I have two tables channels and subscribers. Channels has fields like channelid, channelname,userid,added_time etc. The subscriber table has id,channelid,subscriber_id.
Now i want to pick the channels which has userid=1 and subscriber_id from tbl_subscribers where subscriber_id=1.

I have tried the following query.

select t1.channel_name,t2.channelid from tbl_create_channel t1 join tbl_subscribers t2 on t1.uid=1 and t2.subscriber_id=1

But the t2.channelid is repeated along with every channelname. I dont want the output like this.

The output must be it should display all the channelnames and at last it should display the channelid.

Pls Help Me. Its Urgent
Dec 6 '07 #1
Share this Question
Share on Google+
3 Replies


MarkoKlacar
Expert 100+
P: 296
Hi,

seems to mike like you need to use a WHERE in your query.
Think this will solve you problem if I understood it correctly.

GL
Dec 6 '07 #2

P: 15
Hi,
I have used WHERE but not working. Reply me pls.
Dec 6 '07 #3

MarkoKlacar
Expert 100+
P: 296
Hi,
I have used WHERE but not working. Reply me pls.
Hi,

is the qurey that you posted the latest one that you use?
I can't find a WHERE in that query.
Dec 6 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.