|
-
Feb 7th, 2009, 12:45 AM
#1
Re: MySQL SQL Query I can not slove it
 Originally Posted by dclamp
You need to use a JOIN.
Code:
SELECT * FROM Users LEFT JOIN News WHERE Users.UsersID = News.NewsID LIMIT 3;
The comma between the table names is equivalent to "inner join".
Has someone helped you? Then you can Rate their helpful post. 
-
Feb 7th, 2009, 09:07 AM
#2
Thread Starter
Hyperactive Member
Re: MySQL SQL Query I can not slove it
this also dispaly 3 news only for the first users in the table like:
username1
news1
news2
news3
but I need to display all user and 3 news under every user like:
username1
news1
news2
news3
username2
news1
news2
news3
username3
news1
news2
news3
username4
news1
news2
news3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|