Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Nested INNER JOIN problem

forums forums Nested INNER JOIN problem

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #7960
      u3003-04-23
      Member

      I am using mySQL 3.23.55 on a win2k PC.

      I am also using SQLyog 3.1 (which is great…)

      I want to run this SQL query:

      SELECT v_pdf_info.*, v_pdf_Cat.pdfCatTitle, v_pdf_diff.fldDesc

      FROM v_pdf_diff

      INNER JOIN (v_pdf_Cat INNER JOIN v_pdf_info ON v_pdf_Cat.pdfCatID = v_pdf_info.pdfCatID)

      ON v_pdf_diff.fldID = v_pdf_info.pdfdiff

      WHERE pdfID>0 ;

      When I run it in my ASP pages, and in SQLyog I get this error:

      Error Code : 1064

      You have an error in your SQL syntax near '(v_pdf_Cat

      INNER JOIN v_pdf_info ON v_pdf_Cat.pdfCatID =

      v_pdf_info.pdfCatID) ' at line 4

      (0 ms taken)

      I remember reading something about nested joins not being supported until v4 of mySQL. Am I right? The same sql runs fine in Access.

      Thanks

      Jim

    • #14341
      u3003-04-23
      Member

      I worked it out. code below in case it helps anyone else out:

      v1 from http://forums.devshed.com/showthread.php?s…=&postid=269096

      SELECT v_pdf_info.*, v_pdf_cat.pdfCatTitle, v_pdf_diff.fldDesc

      FROM v_pdf_diff

      INNER JOIN v_pdf_info

      ON v_pdf_diff.fldID = v_pdf_info.pdfdiff

      INNER JOIN v_pdf_Cat

      ON v_pdf_info.pdfCatID = v_pdf_Cat.pdfCatID

      AND pdfID>0;

      v2 from me:

      SELECT v_pdf_info.*, v_pdf_cat.pdfCatTitle, v_pdf_diff.fldDesc

      FROM v_pdf_diff, v_pdf_cat, v_pdf_info

      where

      v_pdf_cat.pdfCatID = v_pdf_info.pdfCatID

      and

      v_pdf_diff.fldID = v_pdf_info.pdfdiff

      and

      pdfID>0;

      jim

Viewing 1 reply thread
  • You must be logged in to reply to this topic.