[SQL] Retrieve the column values of a record without knowing the names

2011-02-17 Thread arthur_info
Hello, I've got the following function and I want to access the fields values of my record by index. The problem is that my select is retrieving each record line with all values and not each one of each row on my view... How can I solve this problem? Thanks in advance. CREATE FUNCTION fc_test

Re: [SQL] Is it possible to get DISTINCT rows from RETURNING clause?

2011-02-17 Thread Gnanakumar
Any ideas? -Original Message- From: Gnanakumar [mailto:gna...@zoniac.com] Sent: Thursday, February 17, 2011 12:36 PM To: pgsql-sql@postgresql.org Subject: Is it possible to get DISTINCT rows from RETURNING clause? Hi, Is it possible to get DISTINCT rows from an UPDATE statement using RE

Re: [SQL] Function compile error

2011-02-17 Thread Sivannarayanreddy
Title: Thanks Igor Nayman!!! The function worked for me Sivannarayanareddy Nusum | System Analyst(Moneta GDO)

Re: [SQL] ARRAY_AGG and COUNT

2011-02-17 Thread bricklen
On Thu, Feb 17, 2011 at 12:11 PM, Andreas Forø Tollefsen wrote: > Great. Thanks. Do you have a suggestion on how to ignore the group id's with > 0 as value? > I dont want these to be counted. You can probably select your values in a subquery and filter out the 0 value results in the WHERE clause,

Re: [SQL] ARRAY_AGG and COUNT

2011-02-17 Thread Andreas Forø Tollefsen
Great. Thanks. Do you have a suggestion on how to ignore the group id's with 0 as value? I dont want these to be counted. Thanks! 2011/2/17 bricklen > On Thu, Feb 17, 2011 at 6:20 AM, Andreas Forø Tollefsen > wrote: > > Hi all! > > > > I have tried the below query, but i cannot find a way to s

Re: [SQL] ARRAY_AGG and COUNT

2011-02-17 Thread bricklen
On Thu, Feb 17, 2011 at 6:20 AM, Andreas Forø Tollefsen wrote: > Hi all! > > I have tried the below query, but i cannot find a way to select only > DISTINCT into the ARRAY_AGG function. I also do not want 0 to be included in > the array or 0 to be counted. > > Code: > > SELECT priogrid_land.gid, p

Re: [SQL] After insert trigger and select

2011-02-17 Thread Igor Neyman
> -Original Message- > From: Rok Jaklič [mailto:r...@rasca.net] > Sent: Wednesday, February 16, 2011 5:35 PM > To: pasman pasmański; pgsql-sql > Subject: Re: After insert trigger and select > > On 02/16/2011 08:46 PM, pasman pasmański wrote: > >> If I have after insert trigger on som

[SQL] ARRAY_AGG and COUNT

2011-02-17 Thread Andreas Forø Tollefsen
Hi all! I am working on a query to identify which group ids exists within a spatial cell. In this case i have the GREG table which has polygon data and the priogrid_land which have the cell polygon. I want to identify which and how many GREG group ids exists within each of the priogrid_land cells.