how to convert character strings to dates? : Sql dba



how to convert character strings to dates? : Sql dba..

Answer / Pramodh Kumar

In SQL, you can convert character strings to dates using various functions depending on the database system you are using. For MySQL and Oracle (PL/SQL), you can use the STR_TO_DATE() or TO_DATE() function respectively. Here is an example for both databases:nnMySQL:n```sqlnSELECT STR_TO_DATE('2021-03-04', '%Y-%m-%d');n```nOracle PL/SQL:n```sqlnDECLARE date_var DATE;ndate_var := TO_DATE('2021-03-04', 'YYYY-MM-DD');n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

How to use sql statements in pl/sql?

1 Answers  


what is 'mysqlimport'? : Sql dba

1 Answers  


What are reports usually used for?

1 Answers  


How do you know if a relationship is 2nf?

1 Answers  


Is it possible to create the following trigger: before or after update trigger for each row?

1 Answers  


how will you find out the last three records in a table with n no of records and delete them

3 Answers  


What does varchar include?

1 Answers  


in sql table follw columns r their vehicle_no|servicetype|date|location| 1234 |1FS |1-JAN|PUNE| 4561 |2FS |5-JAN|PUNE| 1234 |PS |7-JAN|PUNE| 1234 |PS |15-JAN|MUMB| i want o/p below vehicleno|1fs|1fsdate|1fslocation|1ps|1PSDATE|1PSLOC|2PS|2PS DATE|2PSLOCA e.g 1234|1FS|1JAN|PUNE|1PS|7JAN|PUNE|2PS|15JAN|MUMBAI PLS help me out to execute using sql query

1 Answers  


How many types of cursors supported in pl/sql?

1 Answers  


What is clustered, non-clustured and unique index. How many indexes can be created on a table ?

3 Answers   TCS,


Write the alter statement to enable all the triggers on the t.students table.

1 Answers  


If i can use sys.check_constraints to display my constraints from my database using sql server 2005, how can i display then if i am using sql server 2000????

1 Answers  


Categories