Re: [SQL] select vs. select count

2007-03-30 Thread Claus Guttesen
> select order_id from > (select o.order_id from orders o join order_lines ol using (order_id) > where o.time > '2006-01-01T00:00' and o.time < '2007-01-01T00:00' > and (ol.item_id = 10 or ol.item_id = 11 or ol.item_id = 12) group by > o.order_id) as prints > inner join > (select ho.order_

[SQL] using sql on v7.4 server to feed stored procedure

2007-03-30 Thread Brian Jarrett
I just found out that I posted this to the wrong list before, so if this ends up as a cross-post, I'm sorry. I've created some sql scripts to update a database in version 8.x and now I'm trying to get them to run on servers using v7.4 The following statement works on 8.x servers, but not on 7.4

Re: [SQL] using sql on v7.4 server to feed stored procedure

2007-03-30 Thread Tom Lane
"Brian Jarrett" <[EMAIL PROTECTED]> writes: > The following statement works on 8.x servers, but not on 7.4 and I > can't figure out how to get it to operate in the earlier version: > select calc_cum_gpa_mp(marking_period_id::TEXT) > from (select distinct marking_period_id from student_mp_stats) as

[SQL] function return array

2007-03-30 Thread Karthikeyan Sundaram
Hi, I am using Postgres 8.1.0. I have a requirement. I will create a function accepting few parameters. This will check into various tables and give back an array of values. Is it possible to return an array from the function? Please guide me. Regards skarth __

[SQL] plpgsql function return array

2007-03-30 Thread Karthikeyan Sundaram
Hi, I am using Postgres 8.1.0. I have a requirement. I will create a function accepting few parameters. This will check into various tables and give back an array of values. I want to use the pgpsql block. I know that we can create using language sql. Is it possible to return an ar