thanks! I think this is the best answer I will get.
On Wed, Jan 12, 2011 at 6:05 PM, Jasmin Dizdarevic <
jasmin.dizdare...@gmail.com> wrote:
> There is probably a more elegant way, but this could help you.
>
> select i.source_id, nm.name, i.mxscore from (
> select sl.source_id, max(score) mxsco
There is probably a more elegant way, but this could help you.
select i.source_id, nm.name, i.mxscore from (
select sl.source_id, max(score) mxscore from source s
inner join sourcelevel sl on s.source_id = sl.source_id
inner join level l on sl.level_id = l.level_id
group by 1
) i
inner join (
sel
Close! but I need the name of the LEVEL with highest score, and I dont
think I can get it this way.
Thanks for trying though!
On Wed, Jan 12, 2011 at 5:49 PM, Jasmin Dizdarevic <
jasmin.dizdare...@gmail.com> wrote:
> It's currently late, so excuse me if I'm wrong. Is this, what you like to
> hav
It's currently late, so excuse me if I'm wrong. Is this, what you like to
have?
select sl.source_id, max(score) from source s
inner join sourcelevel sl on s.source_id = sl.source_id
inner join level l on sl.level_id = l.level_id
group by 1
This is the highest score per source_id.
2011/1/12 Geor
hmm, but if I try to constrain the inner query to the source_id of the outer
query I get an error as follows:
select source.source_id, score, name from source
left join ( select * from sourcelevel, level where sourcelevel.level_id =
level.level_id and sourcelevel.source_id = source.source_id order
The following sql is intended to produce a list of all unique SOURCEs,
along with the corresponding LEVEL.NAME for LEVEL with highest SCORE value
via SOURCELEVEL.
I'd like to know why it doesn't return a SCORE value for SOURCE with id 3,
despite there being a SOURCELEVEL entry for it.
Many thank