Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Cebu City
    Posts
    9

    Unanswered: LIMITfunction and join queries

    Query 1 : SELECT * FROM TABLE_A, TABLE_B, TABLE_C LIMIT 10 WHERE TABLE_A.ID = TABLE_B.ID AND TABLE_B.ID = TABLE_C.ID
    Query 2: SELECT * FROM TableC INNER JOIN (SELECT * FROM TableA INNER JOIN TableB ON ID) RS1 ON ID LIMIT 10

    I'm currently using mysql standard v4.1.7. Whenever i run both queries (see above), it generates an error message, which is 'check version....' Could somebody pls tell me what's wrong with my syntax?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    query 1 is getting an error because LIMIT has to come at the end
    Code:
    select * 
      from TABLE_A
         , TABLE_B
         , TABLE_C 
     where TABLE_A.ID = TABLE_B.ID 
       and TABLE_B.ID = TABLE_C.ID
    limit 10
    query 2 is getting an error because the ON clauses are incomplete
    Code:
    select * 
      from TableA 
    inner 
      join TableB 
        on TABLE_A.ID = TABLE_B.ID
    inner
      join TableC
        on TABLE_B.ID = TABLE_C.ID
    limit 10
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Oct 2003
    Location
    Cebu City
    Posts
    9

    thanks

    yes, you're right. thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •