473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Order of the columns (timestamp) in create statement makes a difference

The first timestamp will always be "automatically generated time." So if
the record is updated, or inserted, this time gets changed. However, if the
column order is changed with an alter statement, this is no longer the case.

create table t (
a int,
b int,
timeUpdate timestamp,
timeEnter timestamp );

Note above Update and timeEnter, although both are defined as timestamp,
operate differently.
Reference (See TIP 3):
http://unc.dl.sourceforge.net/source...ADME_mysql.txt

I hope this helps...it threw me for a loop the first time.

If you have an interesting TIP can you send it to me or post it? I'll add
to the list to benefit everyone.

Regards,

Mike Chirico
Jul 20 '05 #1
1 1321

"Mike Chirico" <mc******@comcast.net> skrev i en meddelelse
news:JY********************@comcast.com...
The first timestamp will always be "automatically generated time." So if
the record is updated, or inserted, this time gets changed. However, if the column order is changed with an alter statement, this is no longer the case.
create table t (
a int,
b int,
timeUpdate timestamp,
timeEnter timestamp );

Note above Update and timeEnter, although both are defined as timestamp,
operate differently.


To avoid confusion, only use one timestamp, make the rest datetime

Leif
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
1
by: MultiTaskinG | last post by:
I want to retrieve all comment stored from my web users ordered BY THREAD and BY TIMESTAMP (INT 11) with a single query (if is possible) now I launch this query: SELECT thread, timestamp,...
6
by: alederer | last post by:
Hallo! I have a table tstest(ts char(13) for bit data constraint a unique). This column is filled in a trigger with generate_unique(). In a application (CLI), I have the values of this...
0
by: phil campaigne | last post by:
Hi I'm trying to create a select statement that will return all rows that are older than 30 milleseconds. Is either of these correct? select event_id from event where...
29
by: pb648174 | last post by:
I have the following basic statements being executed: Create a temp table, #TempPaging Insert Into #TempPaging (Col1, Col2) Select Col1, Col2 From SomeOtherTable Order By Col2, Col1 Select...
3
by: Beowulf | last post by:
I was just messing around with some ad hoc views and table returning UDFs today so I could look at and print out data from a small table and noticed something strange. If I stick my select...
3
crabpot8
by: crabpot8 | last post by:
I am decent at queries, but recently i made a new DB with about 50000+ entries. Queries are taking almost 20+ seconds, and i think it is that i dont have decently structured keys - this is the first...
0
by: Frank Swarbrick | last post by:
So we're trying to decide if it's better to use IDENTITY columns or sequences to create a surrogate key as the primary key for our tables. I kind of like the identity column, because it's more...
5
by: Henry J. | last post by:
I know this could be a dumb question, I just want to confirm that it is faster to execute inserts, if a timestamp field is set to have a default value, like DEFAULT CURRENT TIMESTAMP, and skip that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.