Re: [SQL] select & group by

2005-04-04 Thread Michael L. Hostbaek
Ragnar Hafstaư (gnari) writes: > On Mon, 2005-04-04 at 10:47 +, Ragnar Hafstaư wrote: > > On Mon, 2005-04-04 at 12:16 +0200, Michael L. Hostbaek wrote: > > > [problem] > > [slightly broken solution] > > I forgot a FROM clause, and you might want to add a

[SQL] select & group by

2005-04-04 Thread Michael L. Hostbaek
I've got a problem selecting some specific data from my table. Imagine the following rows: part| mfg | qty | price | eta --- TEST1ABC 10 100(No ETA, as item is in stock) TEST1ABC 12 120 04/04 TEST2CBA

Re: [SQL] Group by and aggregates

2004-11-05 Thread Michael L. Hostbaek
Franco Bruno Borghesi (franco) writes: > If I understand well, you want the highest cmup for each partno, that is > max(cmup) grouped by partno (only). > > SELECT T.partno, T.status, TMP.max_cmup_for_partno, max(T.cmup) AS > max_cmup, sum(T.qty) AS sum_qty > FROM my_table T, (SELECT partno,

[SQL] Group by and aggregates

2004-11-04 Thread Michael L. Hostbaek
t being grouped, but since it's the same partno I'd like somehow to show the highest cmup. Is there some black SQL voodoo that'll achieve this ? TIA, -- Best Regards, Michael L. Hostbaek */ PGP-key available upon request /* pgpfuewP5VRxX.pgp Description: PGP signature

[SQL] postgresql multiple insert slow

2004-06-05 Thread Michael L. Hostbaek
it takes almost 25 minutes to complete.. I tried running the script while just grabbing the rows from the oracle database and writing to a text file - and then it only takes a couple of minutes .. So it must be the INSERT command that chokes - is there a better way to do it ? Any advise much appreciat

[SQL] Performance issue

2004-04-27 Thread Michael L. Hostbaek
0.00ms... Any ideas ? /mich -- Best Regards, Michael L. Hostbaek */ PGP-key available upon request /* ---(end of broadcast)--- TIP 8: explain analyze is your friend