Skip to content
Advertisement

Tag: postgresql

Trouble comparing to_char(timestamp, ‘day’) = ‘monday’

In a PostgreSQL database, I’ve got a table payment with a column payment_date of type timestamp. My goal is to count payments made on Monday. The following query: gives result such as: However when I try to count Mondays like this: the result is 0 even though the previous query shows it should be greater than 0. What’s wrong about

Finding records older than a minute

I have a users table which consists of some columns like name,age,created_at created_at contains time in unix timestamps format (epoch). I basically want to create a query to show all queries that …

Why does the id serial primary key keep changing?

I have just started a full stack web developer course which includes PostgreSQL. I have been give some practice questions to do and when I clicked on run SQL it displays the id, first_name and last_name but when I entered in more lines of code to answer more questions and clicked on run SQL again, the id number changed to

Advertisement