Results 1 to 7 of 7

Thread: MySQL SQL Query I can not slove it

Hybrid View

  1. #1
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: MySQL SQL Query I can not slove it

    Quote 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.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    259

    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
  •  



Click Here to Expand Forum to Full Width