INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Why Are There Duplicate Data Types

Why Are There Duplicate Data Types

(OP)
New to MySql. Why are there two datetime data types as well as duplicates of other types when you are adding a column? Are they different?

Auguy
Sylvania/Toledo Ohio

RE: Why Are There Duplicate Data Types

Quote:

Are they different?

Of course that's why they exist and are NOT duplicates, plus there are THREE types for date columns.

Date, Datetime and TimeStamp

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Why Are There Duplicate Data Types

(OP)
OK, But I see a DateTime in a group at the top and another DateTime further down the list when I click the down arrow of the combo box for data types. Just wondering why there are two entries.

Auguy
Sylvania/Toledo Ohio

RE: Why Are There Duplicate Data Types

"at the top and further down" of WHAT exactly????

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Why Are There Duplicate Data Types

(OP)
When I'm altering the table and I click the combo box in the Data Type column I get a list of several groups of data types separated by a line with only a dash. In that list several of the types are listed more than once.

Auguy
Sylvania/Toledo Ohio

RE: Why Are There Duplicate Data Types

Oh dear deity! It's like pulling teeth!!!!

MySQL does NOT HAVE A "Combo Box" it has a command line and that's ALL.




Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Why Are There Duplicate Data Types

(OP)
Sorry, I'm using the workbench to create and alter the tables.

Auguy
Sylvania/Toledo Ohio

RE: Why Are There Duplicate Data Types

"The workbench" being????

You need to remember that most TT members answering question do not use ANY WYSIWYG 'tools' for working with MySQL, so we have no idea what "the workbench" is, other than something that occupies a chunk of space in the garage.

So I am going to take a guess.

The "one at the top" is what the column is currently set to, and "the one further down" is the result of a lazy programmer just listing ALL the possibles values and neglecting to omit the one already set.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Why Are There Duplicate Data Types

I believe the OP is talking about the MYSQL Workbench. which some actually do use.

In any case, the Date, DateTime, and Timestamp datatypes each hold the information a little differently.

You may want to take a look at the MYSQL manual, and the specific entry for Date datatypes.

http://dev.mysql.com/doc/refman/5.0/en/datetime.ht...

Quote:


The DATE type is used for values with a date part but no time part. MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The supported range is '1000-01-01' to '9999-12-31'.

The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.

The TIMESTAMP data type is used for values that contain both date and time parts. TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech

RE: Why Are There Duplicate Data Types

Quote:

I believe the OP is talking about the MYSQL Workbench. which some actually do use.

Sure, some may, I can't say I have ever used it or even knew of it's existence until the few seconds before posting this reply. The last tool I used for MySQL was "HeidiSQL" and it has been a long time since I had that installed let alone used.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Why Are There Duplicate Data Types

Oh Phil, assuming you do use it, .. How close was my guess?? :)

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Why Are There Duplicate Data Types

(OP)
OK, I know the differences between the date, datetime, etc types. My question is why are some of the EXACT same types listed more than once in the Workbench drop down for data type?

Auguy
Sylvania/Toledo Ohio

RE: Why Are There Duplicate Data Types

Quote:

My question is why are some of the EXACT same types listed more than once in the Workbench drop down for data type?

No idea, ... but have a look at my guess in post six and then check other columns with different types to see if the supposition holds true for all data types.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Why Are There Duplicate Data Types

Quote:


Oh Phil, assuming you do use it, .. How close was my guess?? :)
Well... uh... I don't really use Workbench. but I do have it installed.

And looking into it... Not too far off.
I can see, when altering a table the datatypes are grouped. The first one is the one currently selected, second is the set of what I can only assume are most used Datatypes.Int, Varchar, Datetime etc...

Then come the binary and blob types. Followed by the datetime group. I can see the Datetime type (twice) 3 times if you count the one currently set. But its clear from the grouping why it exists twice in the listings. Once in the most used Group and a second time in the Date/Time group.

Other types also appear more than once. But usually only if they appear in the first group. will they appear again.









----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech

RE: Why Are There Duplicate Data Types

(OP)
Thanks Phil, that explains it.

Auguy
Sylvania/Toledo Ohio

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close