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

Поиск
Список
Период
Сортировка
От Gnanakumar
Тема Re: Is it possible to get DISTINCT rows from RETURNING clause?
Дата
Msg-id 001e01cbcf30$e35cca00$aa165e00$@com
обсуждение исходный текст
Ответ на Is it possible to get DISTINCT rows from RETURNING clause?  ("Gnanakumar" <gnanam@zoniac.com>)
Ответы Re: Is it possible to get DISTINCT rows from RETURNING clause?  (Dmitriy Igrishin <dmitigr@gmail.com>)
Список pgsql-sql
Any ideas?

-----Original Message-----
From: Gnanakumar [mailto:gnanam@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 RETURNING
clause?

"MYTABLE" columns are:APRIMARYKEYCOLUMNABOOLEANCOLUMNEMAILCOLUMN1COLUMN2COLUMN3

UPDATE using RETURNING clause query:
UPDATE MYTABLE SET ABOOLEANCOLUMN = true FROM MYTEMPTABLE WHERE EMAIL =
MYTEMPTABLE.EMAIL RETURNING EMAIL, COLUMN1, COLUMN2, COLUMN3;

Here in this case, I expect to return distinct rows from these columns:
EMAIL, COLUMN1, COLUMN2, COLUMN3. 

I even tried out some ways of getting distinct rows, but it doesn't work.
Though I can still solve this at application layer, I'm trying to find
whether this could be controlled at query-level.  Any different
ideas/suggestions are appreciated.

Regards,
Gnanam



В списке pgsql-sql по дате отправления:

Предыдущее
От: Sivannarayanreddy
Дата:
Сообщение: Re: Function compile error
Следующее
От: arthur_info
Дата:
Сообщение: Retrieve the column values of a record without knowing the names