Re: mysql problem in a php book

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In message <A26BE5D4-B399-432F-8462-B9F2B24175A0@xxxxxxxxxxxxxxxxxx>,
Joe Forsythe <jforsythe@xxxxxxxxxxxxxxxxxx> writes
>What is your question/what problem are you having?
>--
>Joe

Hey, Joe, as I read the original, I thought, great, we have all the
details we need for once... <G>

He did say
>> Message d'erreur : Unknown column 'a.type_id' in 'on clause'

1) You have create_date rather than creation_date
2) The tables are in the wrong order for a JOIN - in the FROM section, I
have swapped a c for c a

SELECT
  a.name,
  a.type_id,
  b.title,
  b.description,
  b.content_date,
  b.creation_date,
  b.created_by,
  b.last_upd_date,
  b.last_upd_by,
  c.name          as dept_name,
  content_id
FROM Department c,
  Content_Type a
  LEFT OUTER JOIN Content b
    on a.type_id = b.content_type
      and a.type_id = b.content_type
      and b.dept_id = 3
      and b.content_type = 4
WHERE c.dept_id = 3
ORDER BY content_date DESC

And I get 4 records returned.

They may not be the right ones, but...
-- 
Pete Clark

Hot Costa - Local Spain
http://www.hotcosta.com

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux