when i declare date data type in sql ,i inserted the date
22-10-2012,but my result is in different date 1894-07-11 any
one pls help me what's wrong in my query
Create table orders(od_id int,od_name varchar(10),od_date
date)
insert into orders values(1,'sai',22-10-2012) and any one
pls suggest what i can learn for 3 years real time
experenice in sql because i am looking for database field

Answer Posted / lakshmi

The default date format in sql is 'yyyy-mm-dd' but in the query that is in dd-mm-yyyy and without single quotes. Below is the insert query.

insert into orders values(1,'sai','2012-10-22');

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can mysql function return a table?

597


What is the return type of mysqli_query?

458


What is a data directory?

509


What is the difference between char and varchar in mysql?

502


If you are assigned a task, to find the information of procedures. What are the basic commands that you will use to do so?

494






Is there a way to see the files which are stored?

489


What is row level locking in access?

477


Can I use mariadb instead of mysql?

484


Why myisam is faster than innodb?

482


How to escape special characters in sql statements?

523


Does insert statement lock the table?

503


Is mysql owned by oracle?

532


What is the current version of mysql?

477


What is key in mysql?

495


Can we rollback truncate in mysql?

515