How does following query work , could not find documents explaining how following query works.Are there any other similar queries for casting values?
SELECT date \'2017-
Your query is using a date literal. From the Oracle documentation:
You can specify a DATE value as a string literal, or you can convert a character or numeric value to a date value with the TO_DATE function. DATE literals are the only case in which Oracle Database accepts a TO_DATE expression in place of a string literal.
To specify a DATE value as a literal, you must use the Gregorian calendar. You can specify an ANSI literal, as shown in this example:
DATE '1998-12-25'