Re: sql union all to def()

2013-04-11 Thread Rafael E. Ferrero
Tommy, an store procedure its a piece of sql code that its executed by the data base server (take a look here http://www.postgresql.org/docs/8.0/static/plpgsql.html), so you execute that procedure from django with a raw sql statement. Im not familiar with postgresql but in firebird you can do: SE

Re: sql union all to def()

2013-04-11 Thread Tommy
Hi Rafael, Thank you for the reply. Not too sure if I undersatnd all of it, though. My learning curve is more down than up. You mentioned a possibly better process "using the store procedure". Do you know of any examples of what you have in mind, perhaps? I have not found a function in Dj

Re: sql union all to def()

2013-04-10 Thread Rafael E. Ferrero
I think that you can get all your table data on a Django View and then make an algorithm to have your data, maybe using a recursive function. Like i understand you are putting together every single field in one... so your first result its one field (val) then you are counting all similar value, so