[thelist] SQL: ORDER with two parameters

Adriano Castro ad at netvisao.pt
Wed Mar 31 03:22:38 CST 2004


    It's not working for me...

    It says "Syntax error (missing operator) in query expression
'd1.id=dr.id_doc INNER JOIN doc_list d2 ON dr.id_referrer=d2.id".

    I the error's in the nested JOIN but can't seem to be able to clean it
up.

    Anyone?

    Sorry about that but these are my 1st (real) steps in SQL.


    AD


Tab Alleman suggested:

Maybe...

SELECT d1.id, d1.id_type, d1.reference
FROM doc_list d1
INNER JOIN doc_relationships dr ON d1.id=dr.id_doc
INNER JOIN doc_list d2 ON dr.id_referrer=d2.id
WHERE d1.id_type=2
ORDER BY d2.reference, d1.reference

?

-- 



More information about the thelist mailing list