[SQL] Please help with a query..

2006-04-17 Thread Timo Tuomi
d be something like this: dep_dateX_Y_Z_time 2005-01-11 6 hours 15 mins 2005-01-12 5 hours 49 mins 2005-01-13 6 hours 05 mins (the times above are not correct) Any help would be greatly appreciated. Thanks, Timo CREATE temp TABLE foo ( pta text, atime timestamp without time zone, pt

[SQL] datatype conversion on postgresql 7.4.1

2005-05-22 Thread Timo Roessner
hi everybody, i got the following problem: i have a database running on a postgresqlserver version 7.4.1, in the database is a table with 4 columns containing float-numbers. what i want to do now is, to convert the type of those columns from float to numeric, because i want to limit the posi

[SQL] A tricky sql-query...

2003-10-23 Thread Timo
27;t spend too much time on this because it has already been implemented with PL/PgSQL. But just out of the curiosity - and for the educational purposes :) - I'd like to know whether you can do this with a single sql-query? You can't have any recursion in an pure sql-query, can yo

[SQL] Need to overcome UNION / ORDER BY restriction

2003-09-29 Thread Timo
but it's not quite enough and when I try select * from foo order by case when priority = 1 then priority else seniority, priority end; it's parse error at or near ",". Any suggestions? Thanks in advance, Timo --- CREATE TABLE foo ( id integer, priority in