[SQL] skip if latter value equal

2009-07-10 Thread Marcin Krawczyk
Hi list, I was wondering if it was possible for a field in SQL query to return NULL if latter value is exactly the same ? - for given ORDER BY clause, I guess. For example, query returns: xxyy 1 4 true xxyy 5 7 true xxyy 21 8 true yyzz 5 1 false yyzz 7 7 false yyzz 8 34 false I'd

Re: [SQL] skip if latter value equal

2009-07-10 Thread Pavel Stehule
Hello you can do it simply in new PostgreSQL 8.4. In older version the best way what I know is using a stored procedure, that returns table create or replace function foo() returns setof yourtablename as $$ declare r yourtablename; s yourtablename; result youratblename; first boolean =

Re: [SQL] skip if latter value equal

2009-07-10 Thread Marcin Krawczyk
Thanks a lot. pozdrowienia mk 2009/7/10 Pavel Stehule pavel.steh...@gmail.com Hello you can do it simply in new PostgreSQL 8.4. In older version the best way what I know is using a stored procedure, that returns table create or replace function foo() returns setof yourtablename as $$