Hello, i have the following Oracle table:
GAMES
id_game int
id_user int
dt_game DATE
Before creating a new record i must check that the same user has not inserted a game more that N times a day.
I'm actually selecting the number of games played today in this way:
select count(1) as num from GAMES
where id_user=ID_USER and
to_char(dt_game,'DD/MM/YYYY')=to_char(sysdate,'DD/MM/YYYY')
I don't like it too much: is there a better way to do it?
Thanks in advance c.