Re: [SQL] Stalled post to pgsql-sql

2009-12-09 Thread sergey kapustin
Hello, I need a type that will store date and time, but without seconds and microseconds (like timestamp does). At least without microseconds. I also need all the operators to work. Is this possible with one of existing date/time types or i need to create my own? Thank you!

Re: [SQL] Show CAS, USD first; the left ordered by currency name

2009-07-30 Thread sergey kapustin
...order by currency not in('USD', 'AND', 'CAD'); this condition will be avaluated as FALSE for USD, AND and CAD, and as TRUE for all other currencies. When the records are sorted the "false" are placed on the top because false wrote: > Good morning, > > I have a currency table (code, description

[SQL] EXECUTE with a prepared plan and NULL

2009-01-04 Thread sergey kapustin
Hello! I'm trying to run this code in one of my stored procedures s := 'execute prepared_plan( ' || id_engine || ',' || id_search || ',' || id_rsite || ')'; execute s; where "prepared_plan" is a statement defined before with PREPARE. The thing is, that if i one of the parameters is NULL, then

[SQL] Helper aggregate function

2008-02-03 Thread sergey kapustin
Hello! Can anyone tell me how i do this properly? create or replace function agg(varchar,varchar) returns void as $func$ select $1,count(*) from $2 group by $1 order by $1; $func$ Language SQL; Right now this wives me "ERROR: syntax error at or near "$2" at character 97 select $1,count(*