i cannot get what do you mean when you say that?
and i dont know what the result of this query.

my main idea of this query is to get the last round from each game.
how can i do that?

On May 7, 1:55 am, lbendlin <[email protected]> wrote:
> how about using max(dateUpdated)  instead?
>
>
>
>
>
>
>
> On Sunday, May 6, 2012 7:56:20 AM UTC-4, David Hodeffi wrote:
>
> > i have this DB:
>
> > USERS
>
> > userId int PK,
> > userName nvarchar(50)
>
> > GAMES
>
> > gameId int PK,
> > dateCreated datetime
>
> > ROUNDS
>
> > roundId int Pk,
> > gameId int (FK to GAMES),
> > dateCreated datetime,
> > dateUpdated datetime
>
> > ROUNDDETAILS
>
> > roundId int,
> > userId int,
> > point int,
> > primary key(roundId ,userId)
>
> > my problem is that in sqlite i cannot execute this query (cause ther
> > is no support for "raw_number() over(...)":
>
> > select
> >     AllRound.roundId RoundId,
> >     AllRound.gameId,
> >     RD.userId,
> >     U.userName,
> >     RD.point
> > from
> >     (select
> >         R.roundId,
> >         R.gameId,
> >         dateUpdated,
> >         row_number() over(partition by gameId order by dateUpdated
> > desc) Rid
> >     from GAMES g join ROUNDS R on G.gameId=R.gameId) AllRound
> >     join ROUNDDETAILS RD on R.roundId=RD.roundId and points
> >     join USERS U on RD.userId=U.userId
> > where AllRound.Rid=1
>
> > if you familar with sql, so this query returns all the last round of
> > each game
>
> > any suggestions?
>
> > thanks in advance, David!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to