SOLVED ..Please have a look on this group by..,not really

2002-02-19 Thread Oliver Heinisch
Again, thanks to all, who helped. None of your advices gave the desired pair combination >single row preis/ lfd<, but just looking at the first row, gave the correct answer as I grouped by preis, lfd. I was irritated by the results, the command-line gave me. Even as I wanted the quantity of retu

Re: Please have a look on this group by

2002-02-19 Thread Peter Banik
In this case you have to omit GROUP BY from your query. Peter On Tue, 19 Feb 2002, CreaCtion wrote: > At 19.02.2002 10:20, you wrote: > >What would you expect the database to return > Thanks to all so far, > The query should give the smallest price MIN(preis) and the according "lfd" > num

Re: Please have a look on this group by

2002-02-19 Thread CreaCtion
At 19.02.2002 10:20, you wrote: >What would you expect the database to return Thanks to all so far, The query should give the smallest price MIN(preis) and the according "lfd" number of this record. so the answer should only be one pair f.e.: 15200,00 | 41 . I think this should work, as thi

Re: Please have a look on this group by

2002-02-19 Thread Peter Banik
Oliver, > > select min(preis),lfd from database where marke='marke' > and typ not like 'R%' > and typ not like 'X%' > and typ not like 'C%' > group by preis > > this doesn´t bring the expected pair "preis / lfd" but all available > "preis/lfd" grouped ascending. > you're grouping by the same

Re: Please have a look on this group by

2002-02-19 Thread Tod Harter
On Tuesday 19 February 2002 10:07, Oliver Heinisch wrote: What would you expect the database to return You asked it to GROUP all the records with the same preis, that means it has to choose a value for each column of the record that is the result of each grouping, correct? So which of the

Please have a look on this group by

2002-02-19 Thread Oliver Heinisch
Hi Folks, now sitting here for 5 hours trying to get these stupid sql-request running, I decide to ask the list. structual information of the database: database.preis = decimal(12,2), database.lfd=int(11), database.typ=varchar(30), database.marke=varchar(50) The following requests works select