Skip to content
Advertisement

select where time = x or later

I have a table with columns username and timestamp . When a username is entered the current timestamp is as well.

I would like to fetch the rows of all the new users from a certain time until now, but the start time varies. Lets make it a timestamp represented by x.

I would like to use SQL to select all rows in a table which have a time-stamp in the time range of timestamp x up until now().

Advertisement

Answer

select * from tablename where timestamp between cast(x as timestamp) and now();
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement