{"id":1079,"date":"2015-12-22T08:48:03","date_gmt":"2015-12-22T08:48:03","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=1079"},"modified":"2015-12-22T08:48:03","modified_gmt":"2015-12-22T08:48:03","slug":"sorting-with-date-in-oracle-select","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/sorting-with-date-in-oracle-select\/","title":{"rendered":"Sorting with Date in Oracle Select"},"content":{"rendered":"<p>While sorting with date it should be converted using <strong>to_date<\/strong> first with the required format.<\/p>\n<p>Other wise while sorting in Desc Order <em>31-02-2015<\/em> will come in front of <em>21-10-2015<\/em><\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nSELECT * \r\n  FROM tableName\r\nORDER BY to_date(DATE_OF_BIRTH, 'DD-MM-YYYY');\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>While sorting with date it should be converted using to_date first with the required format. Other wise while sorting in Desc Order 31-02-2015 will come in front of 21-10-2015 SELECT * FROM tableName ORDER BY to_date(DATE_OF_BIRTH, &#8216;DD-MM-YYYY&#8217;);<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[171],"tags":[],"class_list":["post-1079","post","type-post","status-publish","format-standard","hentry","category-date"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=1079"}],"version-history":[{"count":1,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1079\/revisions"}],"predecessor-version":[{"id":1080,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1079\/revisions\/1080"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=1079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=1079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=1079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}