[clue-tech] hairy sql (postgres) - suggestions welcome

Sean LeBlanc seanleblanc at comcast.net
Fri Nov 10 09:18:36 MST 2006


On 11-09 22:20, fasiuddin mohammed wrote:
> Hey Dave,
>          Was just going through your query...First of all i did not
> understand why you gave the same condition twice while creating
> dap_test table. Anyways dap_test,dap_in and dap_out can be merged into
> an single table.
> 
> Is there a union in postgresql.. If it is there then all the later
> tables can be merged into a single one using union (since you put an
> outer join later we can even use all) statement. Will try to send you
> a working query but it will take some time...

I was wondering the same thing about UNION...I think it's probably in
SQL-92|99, but I wasn't 100%.

I was also wondering if Postgres has something similar to Oracle's DECODE
and if that could be used in some way. Turns out it does, and in Postgres,
it's called CASE.


-- 
Sean LeBlanc:seanleblanc at comcast.net  
http://sean-leblanc.blogspot.com/
Power corrupts, and absolute power corrupts absolutely. 



More information about the clue-tech mailing list