Postgresql. Release the data from the filter table at the date



  • There is a table from which the name, id and number of uses (name, id, uses) should be chosen on the basis of today ' s date. Date retained in column last_seen in format 2021-11-03 11:01:33.000000♪ I tried to do this:

    SELECT id, full_name, uses, last_seen From users_new WHERE last_seen=localtimestamp(0)::timestamp::date Order by id'
    

    I'm getting an empty conclusion, even though the team's separate from the request, the date can be removed.

    The result is to obtain a list of users who used today.



  • SELECT id, full_name, uses, last_seen 
    from users_new 
    where last_seen::date = current_date
    order by id;
    

Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2