Re: [GENERAL] Complex sql, limit-for-each group by, arrays, updates

2013-12-03 Thread Dorian Hoxha
I'll probably go by using 3 queries and putting them in a transaction. Thanks On Wed, Nov 27, 2013 at 5:38 PM, David Johnston wrote: > Dorian Hoxha wrote > > Hi, > > > > So i have (table where data will be read) : > > CREATE TABLE data (vid,cid,pid,number); > > > > Tables where data will be wr

Re: [GENERAL] Complex sql, limit-for-each group by, arrays, updates

2013-11-27 Thread David Johnston
Dorian Hoxha wrote > Hi, > > So i have (table where data will be read) : > CREATE TABLE data (vid,cid,pid,number); > > Tables where data will be writen/updated: > > CREATE TABLE pid_top_vids (pid, vid[]) > CREATE TABLE pid_top_cids (pid, cid[]) > CREATE TABLE cid_top_vids (cid, vid[]) > > I nee

[GENERAL] Complex sql, limit-for-each group by, arrays, updates

2013-11-27 Thread Dorian Hoxha
Hi, So i have (table where data will be read) : CREATE TABLE data (vid,cid,pid,number); Tables where data will be writen/updated: CREATE TABLE pid_top_vids (pid, vid[]) CREATE TABLE pid_top_cids (pid, cid[]) CREATE TABLE cid_top_vids (cid, vid[]) I need to , possibly in 1 query, this will run o