-
Notifications
You must be signed in to change notification settings - Fork 1
postgres useful commands
Rajesh Khadka edited this page Apr 15, 2020
·
4 revisions
To get current time in postgres
Timezone: now()
UTC time : timezone('utc', now())
select * from **table_name** as user inner join **table_name** as profile on user.id = profile.doctor_id inner join **table_name** fee on profile.id = fee.doctor_profile_id where user.id='54800353-28f6-4e9d-bbc9-b8c3bca59594';
update consultation.consultations set expires = (select CURRENT_DATE + INTERVAL '7 day') where created_at <= '2020-04-09' and frequency > 0;
update consultation.consultations set expires = (select CURRENT_DATE - INTERVAL '7 day') where created_at <= '2020-04-09' and frequency > 0;
we can use day, month, year