Re: [SQL] can i make this sql query more efficiant?

2003-04-03 Thread Franco Bruno Borghesi
if you're allowed to change the resultset structure, you could do: SELECT event, level, count(*) FROM baz GROUP BY event, level; event | level | count ---+---+--- x | 1 | 1 x | 2 | 1 x | 3 | 1 y | 2 | 1 y |

Re: [SQL] pesky plpgsql

2003-04-03 Thread Roberto Mello
On Thu, Apr 03, 2003 at 10:01:36AM -0800, Josh Berkus wrote: > Walter, > > > CREATE FUNCTION update_cat_keys() RETURNS integer AS ' > > declare > >v_row RECORD; > > What's in-between v_row and RECORD? Maybe a non-standard tab character? "non-standard tab character"? Are you saying

[SQL] pesky plpgsql

2003-04-03 Thread Walter McGinnis
Guess I'm an April Fool. When I define the following psql returns "CREATE": -- update all galleries that are categories with their skey and rkey values CREATE FUNCTION update_cat_keys() RETURNS integer AS ' declare v_row RECORD; begin for v_row in select gallery_id, imagedb_gallery_