pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: acec acec <tomcatacec@yahoo.ca>
To: pgsql-sql@postgresql.org
Subject: This SQL works under Mysql, not Postgresql.
Date: Fri, 25 Jan 2008 11:11:53 -0500 (EST)
Message-ID: <692719.53428.qm@web63009.mail.re1.yahoo.com> (raw)

I have the following sql, which works fine under mysql
database:
SELECT sa.ID, suv.TOTAL as VOICE_TOTAL, sus.TOTAL as
SMS_TOTAL FROM SUB_ACCOUNT sa INNER JOIN SUBSCRIBER s
ON (sa.ID = s.SUB_ACCOUNT_ID) LEFT JOIN (SERVICE suv,
SERVICE sus) ON (sa.ID = suv.SUB_ACC_ID AND
suv.SERVICE_ID = 0 AND sa.ID = sus.SUB_ACC_ID AND
sus.SERVICE_ID = 1) WHERE s.TELEPHONE = '111111111';
When I ran it under postgresql, which gave me "ERROR:
syntax error at or near"
It looks like I could not put two table on LEFT JOIN: 
LEFT JOIN (SERVICE suv, SERVICE sus)

Do you have any suggestion for this problem?

Thanks in advance.



      Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/




view thread (6+ messages)  latest in thread

Message-ID: <692719.53428.qm@web63009.mail.re1.yahoo.com>
Permalink:  ../692719.53428.qm@web63009.mail.re1.yahoo.com/
Also on:    postgresql.org/message-id/692719.53428.qm@web63009.mail.re1.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tomcatacec@yahoo.ca
  Subject: Re: This SQL works under Mysql, not Postgresql.
  In-Reply-To: <692719.53428.qm@web63009.mail.re1.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox