Re: sql questions

2018-07-20 Thread hamann . w
>> Zitat von haman...@t-online.de: >> >> > a) I am running some select query >> > select ... order by >> > Now, I would like to preserver the ordering through further >> > processing by adding a sequence number >> > Of course I can do: >> > create temp sequence mseq; >> > select xx.*, ne

Re: sql questions

2018-07-20 Thread Brian Dunavant
On Fri, Jul 20, 2018 at 4:27 AM wrote: > > b) can a sql function return the count of affected rows of some query? > create function merge_names(int, int) returns void as > $_$ > update namelinks set nid = $2 where nid = $1; > -- want the affected rows of the above query > delete from names where

Re: sql questions

2018-07-20 Thread Thiemo Kellner
Zitat von haman...@t-online.de: a) I am running some select query select ... order by Now, I would like to preserver the ordering through further processing by adding a sequence number Of course I can do: create temp sequence mseq; select xx.*, nextval('mseq') as ord from (select ... ord

Re: sql questions

2018-07-20 Thread Laurenz Albe
haman...@t-online.de wrote: > a) I am running some select query > select ... order by > Now, I would like to preserver the ordering through further processing by > adding a sequence number > Of course I can do: > create temp sequence mseq; > select xx.*, nextval('mseq') as ord from (select ..

sql questions

2018-07-20 Thread hamann . w
Hi, a) I am running some select query select ... order by Now, I would like to preserver the ordering through further processing by adding a sequence number Of course I can do: create temp sequence mseq; select xx.*, nextval('mseq') as ord from (select ... order by ) xx; drop sequence