我有以下查詢返回日期爲dd/mm/yyyy hh:mm:ss
,但我想提取時間和日期作爲單獨的列,我該如何做到這一點?我是新來的PostgreSQLPostgreSQL獲取日期
感謝 凱絲
select
up.mis_id,
up.name,
up.surname,
es.created as "signed in",
es1.created as "signed out",
bb.name as "location"
from users_person as up
join users_role as ur on ur.id = up.role_id
join events_event as ee on ee.user_id = up.id
join events_swipe as es on es.id = ee.sign_in_id
join events_swipe as es1 on es1.id = ee.sign_out_id
join buildings_building as bb on bb.id = es.location_id
這工作到一個點,日期和時間現在是獨立的(這是偉大的),日期但格式仍然是DD/MM/YYYY HH:mm:ss的如06/06/2017 00:00:00 – KathH
這是完全不同的問題 - 問問。但請首先尋找現有的答案 - 我相信它已經回答了SO已經 –
@KathH這就是您的客戶端如何顯示它。 PostgreSQL只爲'es.created :: date'(它沒有任何時間組件)發送'date'。 – pozs