MySQL Forums
Forum List  »  Newbie

Re: Importing issues
Posted by: Phillip Ward
Date: March 23, 2016 06:47AM

Two "home truths" about Relational Databases (not just MySQL).

(1) Date values have no format.

Even if they do, it's not any format that would make sense to you and me (unless you're seriously into IEEE data specifications).

The String representations (plural) of Date values do have formats. You apply these when displaying any date value to a user and you "undo" them before storing the date value back into the database.

As Peter said, str_to_date() is your friend here ...

... assuming that the field in your table is defined as a Date. If not, then you're stuck with the "date" format that you don't like.


(2) Rows [in a table] have no order.

Your database will store rows in whatever order it feels is most sensible. That order may or may not make any sense to you and me, but the DBMS will have "Good Reasons" for doing so.

The only way to guarantee the order of rows is to use the "order by" clause as you retrieve ("select") them.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
March 22, 2016 12:38PM
March 22, 2016 12:59PM
March 28, 2016 11:31AM
March 28, 2016 11:48AM
March 28, 2016 11:51AM
March 28, 2016 12:08PM
Re: Importing issues
March 23, 2016 06:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.