Write a query to display schedule id and date in the format of yyyy-mm-dd' and name the column as formatteddate. Display record in ascending order by schedule id.
Answers
Answered by
4
Answer:
Select Schedule_id, to_char(Schedule_date,’yyyy-mm-dd’) as “formatteddate”
From Schedule
Order By Schedule_id
Explanation:
Select will fetch the desired column
From -> To specify table name where the details needs to be fetched
Order by -> To align / arrange data according to the need
to_char -> This is a function to convert date in to the character format thus enabling formatted output.
Here in the given query, the details of Schedule_id and Schedule_date is fetched from Schedule table and then the Schedule_date is formatted to get the output in ‘yyyy-mm-dd’ format and then the results are arranged according to the schedule_id in ascending order.
Similar questions
Economy,
6 months ago
Chemistry,
6 months ago
English,
11 months ago
Computer Science,
11 months ago
Biology,
1 year ago