Syntax problem for a newbie

Поиск
Список
Период
Сортировка
От Fred
Тема Syntax problem for a newbie
Дата
Msg-id 1146823430.885013.124890@j33g2000cwa.googlegroups.com
обсуждение исходный текст
Ответы Re: Syntax problem for a newbie  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Syntax problem for a newbie  (Tony Caduto <tony_caduto@amsoftwaredesign.com>)
Список pgsql-general
Dear all,

I have a syntax problem but I don't find the clue.
Actually I adapt an mySQL query to a postgreSQL but I got a message
error that I can't interpret.

SELECT g.id, t1.name, substring(g.path, 1, (6*(-1+l.id)) + 5) as
subpath,l.id-1 as level
FROM  graph_path g
    INNER JOIN term AS t1
    INNER JOIN term AS t2  ON (t2.id = g.term2_id)
    INNER JOIN levels l ON (substring(path, 1+(6*(-1+l.id)), 5) = t1.id
 AND g.distance+1 >= l.id)
WHERE t2.name = 'blood_coagulation' and g.term1_id=1
ORDER BY g.id, subpath;

ERROR:  syntax error at or near "WHERE" at character 284
LINE 7: WHERE t2.name = 'blood_coagulation' and g.term1_id=1

Let me know if you need details concerning the tables but I don't think
it is necesseray.
Hopefully I did a newbie mistake.

Thanks in advance,

Fred


В списке pgsql-general по дате отправления:

Предыдущее
От: Tuukka Norri
Дата:
Сообщение: Field names and NEW
Следующее
От: "robert"
Дата:
Сообщение: simple md5 authentication problems