Reputation: 41
I want to fetch record based on my where condition.
This is my query.
select * from student where createdDate = '04/18/2013 03:24:49';
But I am not getting any record...
Upvotes: 0
Views: 54
Reputation: 393
In case your createdDate column is of type date, you should use to_date function:
select * from student where createdDate = to_date('mm/dd/yyyy hh24:mi:ss', '04/18/2013 03:24:49');
Upvotes: 2
Reputation: 95062
This is no valid datetime literal you are using. Use this instead:
select * from student where createdDate = timestamp'2013-04-18 03:24:49';
Upvotes: 2