Reputation: 45
I have a table in which I have inserted trainno and its time of arrival now I need to display trains which arrived on PM.
I have tried this
select trainno,to_char(timeofarrival,'HH:MI:SS A.M.')"toa" from train
where to_char(timeofarrival,'HH:MI:SS A.M.')='P.M.';
Upvotes: 0
Views: 46
Reputation: 231781
Sincce timeOfArrival
is a date
WHERE to_number( to_char( timeOfArrival, 'HH24' )) >= 12
will give you the rows where the time component is after noon.
Upvotes: 2