i have this db on sqlite(cause its for android 2.3 smartphones):
(pseudo in sql)
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)
and i would like to execute this query on the db
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
the problem is that i really cannot use the row_number() over( ....)
func
an android solution to this problem with sqlitedatabase class would be
greater usefull than the query but i can handle both cause i can alway
use the sqlitedatabbase.rawquery(...)
thanks in advance
--
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