MySQL의 date, time, date_time, time_stamp의 입력형식 데이터베이스/MySQL

데이터베이스의 날짜를 입력할때 간간히 헤깔리는 경우가 있다.
“1998-12-31″으로 입력해야되는지
“1999/12/31″으로 입력해야되는지
“19991231”으로 입력해야되는지가…
◆ MySQL의 date, time, date_time, time_stamp의 입력형식 
우선 MySQL에서 아무 데이터베이스나 선택해서 밑에 테이블은 만든다.

CREATE TABLE InputTest (date date, time time, date_time datetime, time_stamp timestamp);

아래와 같은 형식으로 데이터를 입력하면 문제없이 데이터가 입력된다.

INSERT INTO InputTest VALUES
(“1998-12-31”, “23:59:59”, “1998-12-31 23:59:59”,19981231235959);

date_time이나 time_stamp는 두가지 입력방식이있다.
① yyyy-mm-dd hh:mm:ss
② yyyymmddhhmmss

INSERT INTO InputTest VALUES
(“1998-12-31”, “23:59:59″, 19981231235959,”1998-12-31 23:59:59”);

밑의 예제와 같이 입력을하면 에러가 뜬다.

INSERT INTO InputTest VALUES
(“1999/12/31″, “13:59:59”, “1998/11/31 21:59:59″,19991231235959);
ERROR 1136 (21S01): Column count doesn’t match value count at row 1

문제없이 입력된 데이터를 보면 아래와 같다.

mysql> select * from inputtest;
+————+———-+———————+———————+
| date       | time     | date_time           | time_stamp          |
+————+———-+———————+———————+
| 1998-12-31 | 23:59:59 | 1998-12-31 23:59:59 | 1998-12-31 23:59:59 |
+————+———-+———————+———————+
1 row in set (0.00 sec)

만들어진 테이블의 정보를 보면 아래와 같다
mysql> desc inputtest;

+————+———–+——+—–+——————-+——-+
| Field      | Type      | Null | Key | Default           | Extra |
+————+———–+——+—–+——————-+——-+
| date       | date      | YES  |     | NULL              |       |
| time       | time      | YES  |     | NULL              |       |
| date_time  | datetime  | YES  |     | NULL              |       |
| time_stamp | timestamp | NO   |     | CURRENT_TIMESTAMP |       |
+————+———–+——+—–+——————-+——-+

위의 표를 보면 timestamp는 디폴트 값이 있다.
timestamp의 값은 입력을 하지 않으면 자동으로 현재 일시를 입력해준다.
(그래서 시간 도장이란 이름이였군)

“MySQL의 date, time, date_time, time_stamp의 입력형식 데이터베이스/MySQL”의 178개의 댓글

  1. It is perfect time to make some plans for the long run and it is time to be happy.
    I have learn this publish and if I may I wish to recommend you few interesting
    issues or tips. Perhaps you could write next articles referring to this article.
    I want to learn even more things approximately it!

  2. Howdy! This post couldn’t be written any better!
    Reading through this post reminds me of my previous room mate!
    He always kept chatting about this. I will forward this article to him.
    Pretty sure he will have a good read. Many thanks for sharing!

  3. I think this is one of the most important info for me.
    And i am glad reading your article. But should remark on few general things, The
    website style is great, the articles is really great : D.
    Good job, cheers

  4. I simply want to mention I am newbie to blogs and really loved your page. Probably I’m want to bookmark your website . You actually come with exceptional articles. Regards for sharing your web page.

  5. Hi there! Would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would really appreciate your content. Please let me know. Thanks

  6. I have to show thanks to the writer for rescuing me from such a scenario. Because of browsing through the the web and obtaining ways which are not powerful, I figured my life was over. Being alive without the presence of solutions to the issues you have resolved all through your entire website is a crucial case, and the ones which could have negatively damaged my career if I had not encountered your web blog. The competence and kindness in controlling all areas was tremendous. I don’t know what I would have done if I hadn’t discovered such a solution like this. I’m able to at this time look ahead to my future. Thanks for your time very much for this high quality and result oriented guide. I will not think twice to suggest your blog to anybody who needs assistance on this issue.

  7. This design is spectacular! You definitely know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Excellent job. I really loved what you had to say, and more than that, how you presented it. Too cool!

  8. I just want to mention I’m all new to weblog and absolutely savored you’re blog. Probably I’m likely to bookmark your website . You amazingly come with exceptional articles. Thanks a bunch for revealing your webpage.

  9. I have been browsing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my opinion, if all site owners and bloggers made good content as you did, the net will be a lot more useful than ever before.

  10. One more issue is that video games are generally serious as the name indicated with the most important focus on knowing things rather than leisure. Although, it comes with an entertainment feature to keep the kids engaged, each one game is usually designed to develop a specific group of skills or program, such as math or research. Thanks for your posting.

  11. I am curious to find out what blog platform you have been working with? I’m experiencing some minor security issues with my latest blog and I’d like to find something more safeguarded. Do you have any recommendations?

  12. Hello there, just became aware of your blog through Google, and found that it’s really informative. I am going to watch out for brussels. I’ll be grateful if you continue this in future. Lots of people will be benefited from your writing. Cheers!

  13. tired from the day I had…..Abbi’s team won their tournament game so we finished UNDEFEATED!!! But it was a rough game and I had to get a little redneck, but we won. Then dress shopping with the girls! Ashley looked beautiful and got a great dress! n.

  14. האישה נסעה עם החברות לחופשת קניות בלונדון ומי יודע מה היא עושה שם. בינתיים אתה לבד בבית ומת משעמום. האישה דאגה לעצמה ויצאה לבלות עם החברות, אולי הגיע הזמן שגם אתה תדאג לעצמך ותפנק את עצמך. אם יש לך קצת זמן בערב או בסוף השבוע ואתה לבד, צא לבילוי עם נערות ליווי. אתה יכול להזמין הביתה נערה, או אם יותר נוח לך לצאת לאחת הדירות הדיסקרטיות ולבלות איתה שם. הנערה תאפשר לך לנקות את הראש מכל המחשבות ולהיות מרוכז אך ורק בהווה, ברגעי העונג בהם אתה מקבל עיסוי מפנק ומשחרר, באווירה נעימה וללא שום צורך בקשר מחייב.

  15. I simply want to mention I am just beginner to blogging and site-building and definitely loved this web-site. Likely I’m planning to bookmark your site . You surely come with superb posts. With thanks for revealing your webpage.

  16. Thanks , I have recently been searching for info about this topic for a while and yours is the greatest I’ve came upon till now. However, what concerning the bottom line? Are you sure concerning the source? rentacar kosova

  17. We are a group of volunteers and starting a new scheme in our community. Your web site offered us with valuable information to work on. You’ve done a formidable job and our whole community will be thankful to you. que es el acne

  18. It’s a pity you don’t have a donate button! I’d without a doubt donate to this fantastic blog! I suppose for now i’ll settle for book-marking and adding your RSS feed to my Google account. I look forward to brand new updates and will share this website with my Facebook group. Chat soon!

  19. I really love your blog.. Great colors & theme. Did you develop this amazing site yourself? Please reply back as I’m planning to create my own personal website and want to learn where you got this from or what the theme is called. Many thanks.

  20. Having read this I thought it was rather informative. I appreciate you finding the time and effort to put Hasil Togel this information together. I once again find myself personally spending a lot of time both reading and leaving comments

  21. Have you ever considered about adding a little bit more than just your articles? I mean, what you say is fundamental and everything. However imagine if you added some great graphics or videos to give your posts more, “pop”! Your content is excellent but with images and clips, this blog could certainly be one of the very best in its field. Excellent blog!

  22. We are a group of volunteers and starting a new scheme in our community. Your web site provided us with valuable information to work on. You’ve done an impressive job and our entire community will be grateful to you.

  23. Great post. I was checking constantly this blog and I am impressed! Extremely helpful info particularly the last part 🙂 I care for such information much. I was seeking this certain information for a very long time. Thank you and good luck.

  24. May I just say what a relief to uncover somebody who really understands what they are discussing on the net. You definitely know how to bring an issue to light and make it important. More people need to read this and understand this side of your story. I was surprised you are not more popular because you definitely have the gift.

  25. Hiya, I am really glad I have found this information. Nowadays bloggers publish just about gossips and web and this is actually annoying. A good website with interesting content, this is what I need. Thanks for keeping this website, I’ll be visiting it. Do you do newsletters? Can not find it.

  26. Hey There. I found your weblog the usage of msn. That is a very neatly written article. I will make sure to bookmark it and come back to read extra of your useful information. Thanks for the post. I’ll certainly return.

  27. Oh my goodness! a fantastic write-up dude. Thanks a lot However We’re experiencing issue with ur rss . Do not know why Struggling to register for it. Could there be any person getting identical rss dilemma? Anyone who knows kindly respond. Thnkx

  28. I really love your site.. Pleasant colors & theme. Did you develop this website yourself? Please reply back as I’m planning to create my very own blog and want to know where you got this from or just what the theme is called. Cheers!

  29. I’m impressed, I have to say. Actually rarely do I encounter a weblog that’s both educative and entertaining, and let me tell you, you’ve gotten hit the nail on the head. Your concept is outstanding; the difficulty is something that not enough individuals are speaking intelligently about. I am very comfortable that I stumbled throughout this in my seek for something referring to this.

  30. I used to be suggested this web site by means of my cousin. I am now not sure whether or not this put up is written via him as nobody else know such exact approximately my trouble. You’re incredible! Thank you!

  31. Hi there, just became aware of your blog through Google, and found that it is really informative. I’m going to watch out for brussels. I’ll be grateful if you continue this in future. A lot of people will be benefited from your writing. Cheers!

  32. A formidable share, I simply given this onto a colleague who was doing a little bit analysis on this. And he in actual fact purchased me breakfast as a result of I found it for him.. smile. So let me reword that: Thnx for the deal with! But yeah Thnkx for spending the time to debate this, I feel strongly about it and love studying more on this topic. If possible, as you change into experience, would you thoughts updating your weblog with extra particulars? It is highly helpful for me. Large thumb up for this weblog put up!

  33. It’s the best time to make a few plans for the future and it is time to be happy. I’ve learn this put up and if I may I want to recommend you some fascinating issues or suggestions. Perhaps you can write subsequent articles relating to this article. I desire to read even more things approximately it!

  34. There are certainly a whole lot of particulars like that to take into consideration. That is a nice point to carry up. I supply the ideas above as common inspiration but clearly there are questions like the one you bring up the place crucial factor will probably be working in honest good faith. I don?t know if best practices have emerged round things like that, but I am sure that your job is clearly recognized as a fair game. Both girls and boys really feel the influence of only a moment’s pleasure, for the rest of their lives.

  35. I wanted to create you a bit of remark in order to say thanks a lot the moment again for these beautiful solutions you have provided above. It is wonderfully open-handed with people like you to offer without restraint all most of us would have offered for sale for an ebook to help with making some cash for their own end, especially considering that you might have tried it if you wanted. Those suggestions in addition acted as a good way to know that other people online have similar dreams really like my personal own to realize good deal more with respect to this issue. I’m certain there are some more pleasant moments in the future for individuals who go through your blog.

  36. Magnificent beat ! I would like to apprentice while you amend your site, how could i subscribe for a blog website? The account helped me a acceptable deal. I had been a little bit acquainted of this your broadcast provided bright clear idea

  37. Once I originally commented I clicked the -Notify me when new feedback are added- checkbox and now each time a remark is added I get four emails with the identical comment. Is there any way you can take away me from that service? Thanks!

  38. Hey there are using WordPress for your site platform? I’m new to the blog world but I’m trying to get started and set up my own. Do you require any html coding knowledge to make your own blog? Any help would be really appreciated!

  39. Aw, this is a very good post. In idea I would like to put in place writing such as this additionally – spending time and actual effort to produce a good article… but what things can I say… I procrastinate alot and also by no indicates often go completed.

  40. I’m impressed, I must say. Really hardly ever do I encounter a weblog that’s both educative and entertaining, and let me tell you, you’ve hit the nail on the head. Your thought is excellent; the difficulty is one thing that not enough persons are speaking intelligently about. I am very happy that I stumbled across this in my seek for something regarding this.

  41. I was wondering if you ever considered changing the structure of your website? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or 2 images. Maybe you could space it out better?

  42. I don’t even know the way I finished up right here, however I thought this submit was once good. I don’t know who you’re but certainly you are going to a well-known blogger should you aren’t already 😉 Cheers!

  43. Nice post. I was checking constantly this blog and I’m impressed! Extremely helpful information specifically the last part 🙂 I care for such information a lot. I was looking for this particular information for a very long time. Thank you and best of luck.

  44. In the grand scheme of things you receive an A with regard to hard work. Exactly where you actually confused us ended up being in the facts. As people say, the devil is in the details… And that could not be more true right here. Having said that, allow me inform you precisely what did do the job. Your writing is actually very powerful and this is probably why I am making the effort to comment. I do not really make it a regular habit of doing that. 2nd, while I can see the jumps in reasoning you make, I am not certain of exactly how you appear to unite the points that make the final result. For right now I will, no doubt subscribe to your point but hope in the foreseeable future you link your facts much better.

  45. I simply wished to thank you so much once again. I’m not certain the things I could possibly have carried out in the absence of the actual strategies documented by you directly on such theme. It absolutely was the alarming difficulty in my opinion, nevertheless viewing this expert technique you handled the issue made me to leap over joy. Now i’m grateful for this service and even sincerely hope you find out what a powerful job your are putting in educating many others by way of your web site. I know that you’ve never come across all of us.

  46. Hmm it looks like your website ate my first comment (it was extremely long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog. I too am an aspiring blog blogger but I’m still new to everything. Do you have any tips for novice blog writers? I’d definitely appreciate it.

  47. My programmer is trying to convince me to move to .net from PHP. I have always disliked the idea because of the costs. But he’s tryiong none the less. I’ve been using WordPress on various websites for about a year and am worried about switching to another platform. I have heard great things about blogengine.net. Is there a way I can transfer all my wordpress posts into it? Any help would be greatly appreciated!

  48. Hello there! I know this is kinda off topic but I was wondering which blog platform are you using for this website? I’m getting sick and tired of WordPress because I’ve had issues with hackers and I’m looking at options for another platform. I would be awesome if you could point me in the direction of a good platform.

  49. Good day! This post could not be written any better! Reading this post reminds me of my old room mate! He always kept chatting about this. I will forward this article to him. Fairly certain he will have a good read. Many thanks for sharing!

  50. Throughout this grand scheme of things you actually receive a B+ for effort and hard work. Where you confused us was first in your facts. As people say, details make or break the argument.. And that could not be much more true at this point. Having said that, let me inform you just what did deliver the results. The text is definitely rather powerful and that is possibly why I am taking the effort in order to comment. I do not make it a regular habit of doing that. Secondly, whilst I can certainly notice the jumps in reason you make, I am not really confident of exactly how you appear to unite the details which in turn help to make the final result. For right now I shall yield to your position however wish in the near future you actually connect the dots better.

  51. Thanks , I’ve just been looking for info approximately this topic for a long time and yours is the greatest I’ve found out so far. However, what in regards to the conclusion? Are you positive about the source?

  52. Nice post. I study something more challenging on totally different blogs everyday. It will always be stimulating to learn content from different writers and follow a bit something from their store. I’d favor to use some with the content material on my weblog whether you don’t mind. Natually I’ll offer you a link on your web blog. Thanks for sharing.

  53. I simply needed to thank you very much all over again. I do not know the things I could possibly have achieved in the absence of these strategies contributed by you over this area of interest. It actually was a very hard condition in my opinion, nevertheless looking at the well-written mode you resolved the issue made me to cry over fulfillment. Extremely happy for your advice and then expect you comprehend what a great job your are providing instructing many others thru your web blog. More than likely you haven’t met all of us.

  54. I’ve been browsing online greater than three hours these days, yet I never discovered any attention-grabbing article like yours. It’s pretty price enough for me. Personally, if all webmasters and bloggers made good content material as you did, the internet might be a lot more helpful than ever before.

  55. I do like the way you have presented this particular challenge plus it does offer us a lot of fodder for thought. However, from everything that I have witnessed, I just trust as the reviews stack on that people today continue to be on point and not get started upon a tirade associated with some other news du jour. Still, thank you for this exceptional piece and though I do not necessarily go along with this in totality, I value the standpoint.

  56. I’m really enjoying the theme/design of your web site. Do you ever run into any internet browser compatibility issues? A number of my blog audience have complained about my blog not operating correctly in Explorer but looks great in Chrome. Do you have any solutions to help fix this problem?

  57. Appreciating the commitment you put into your site and in depth information you offer. It’s nice to come across a blog every once in a while that isn’t the same out of date rehashed information. Excellent read! I’ve saved your site and I’m adding your RSS feeds to my Google account.

  58. Great website you have here but I was curious about if you knew of any message boards that cover the same topics talked about here? I’d really like to be a part of online community where I can get advice from other knowledgeable people that share the same interest. If you have any recommendations, please let me know. Many thanks!

  59. I simply wanted to compose a small comment to appreciate you for those fantastic steps you are sharing at this website. My time consuming internet search has at the end of the day been compensated with wonderful facts to write about with my two friends. I would assert that many of us visitors actually are undoubtedly lucky to dwell in a fine site with so many marvellous professionals with valuable secrets. I feel somewhat fortunate to have seen your webpages and look forward to some more cool times reading here. Thanks a lot again for everything.

  60. Needed to create you the very small note just to thank you very much again for all the beautiful information you’ve discussed in this article. This is quite extremely generous of you to allow publicly what exactly most people might have marketed for an electronic book to end up making some bucks for their own end, especially since you could possibly have done it if you desired. The solutions also acted to be a good way to be certain that someone else have the identical desire the same as my very own to know whole lot more regarding this problem. I’m certain there are numerous more pleasant moments in the future for folks who browse through your site.

  61. Can I simply say what a relief to find somebody who actually is aware of what theyre speaking about on the internet. You definitely know the way to convey a difficulty to mild and make it important. Extra individuals have to learn this and understand this aspect of the story. I cant imagine youre no more common since you undoubtedly have the gift.

  62. Good day! This post couldn’t be written any better! Reading through this post reminds me of my good old room mate! He always kept chatting about this. I will forward this article to him. Fairly certain he will have a good read. Thank you for sharing!

  63. You really make it seem so easy with your presentation but I find this topic to be really something that I think I would never understand. It seems too complicated and very broad for me. I’m looking forward for your next post, I’ll try to get the hang of it!

  64. The next time I read a blog, I hope that it doesnt disappoint me as a lot as this one. I imply, I know it was my option to learn, however I actually thought youd have something attention-grabbing to say. All I hear is a bunch of whining about something that you might repair in case you werent too busy looking for attention.

  65. fantastic submit, very informative. I’m wondering why the other experts of this sector do not understand this. You should continue your writing. I am confident, you have a huge readers’ base already!

  66. 핑백: Buy Steroids Online

  67. I know this if off topic but I’m looking into starting my own weblog and was curious what all is needed to get set up? I’m assuming having a blog like yours would cost a pretty penny? I’m not very internet savvy so I’m not 100 positive. Any suggestions or advice would be greatly appreciated. Cheers

  68. Undeniably believe that which you said. Your favorite justification seemed to be on the net the easiest thing to be aware of. I say to you, I definitely get irked while people consider worries that they just don’t know about. You managed to hit the nail upon the top and defined out the whole thing without having side effect , people can take a signal. Will likely be back to get more. Thanks

  69. Oh my goodness! Awesome article dude! Thanks, However I am experiencing troubles with your RSS. I don’t understand why I cannot subscribe to it. Is there anybody having identical RSS issues? Anyone that knows the answer will you kindly respond? Thanks!!

  70. I must express appreciation to the writer just for rescuing me from this particular dilemma. Right after surfing around throughout the the web and obtaining notions which were not beneficial, I thought my life was gone. Being alive devoid of the answers to the difficulties you’ve solved as a result of your main review is a serious case, and those which could have badly affected my career if I hadn’t noticed your blog post. That know-how and kindness in maneuvering all the pieces was crucial. I don’t know what I would have done if I hadn’t discovered such a step like this. It’s possible to now relish my future. Thanks for your time so much for this impressive and effective guide. I will not think twice to refer the website to anyone who ought to have guide on this topic.

  71. What i don’t realize is actually how you are not really much more well-liked than you may be right now. You’re very intelligent. You realize thus considerably relating to this subject, produced me personally consider it from so many varied angles. Its like women and men aren’t fascinated unless it’s one thing to do with Lady gaga! Your own stuffs nice. Always maintain it up!

  72. I truly wanted to write a simple note so as to say thanks to you for all the lovely advice you are giving here. My extensive internet lookup has at the end been recognized with professional knowledge to talk about with my friends and classmates. I would assert that many of us site visitors are undeniably endowed to dwell in a superb place with so many lovely professionals with good tricks. I feel extremely fortunate to have discovered the weblog and look forward to some more excellent moments reading here. Thank you once again for all the details.

  73. I must say, as a lot as I enjoyed reading what you had to say, I couldnt help but lose interest after a while. Its as if you had a wonderful grasp on the subject matter, but you forgot to include your readers. Perhaps you should think about this from far more than one angle. Or maybe you shouldnt generalise so considerably. Its better if you think about what others may have to say instead of just going for a gut reaction to the subject. Think about adjusting your own believed process and giving others who may read this the benefit of the doubt.Jobs offered

  74. Thanks for making me to gain new thoughts about desktops. I also possess the belief that certain of the best ways to keep your mobile computer in excellent condition has been a hard plastic material case, as well as shell, that matches over the top of the computer. A majority of these protective gear usually are model unique since they are manufactured to fit perfectly on the natural covering. You can buy them directly from owner, or from third party sources if they are designed for your mobile computer, however only a few laptop may have a spend on the market. Once again, thanks for your recommendations.

  75. A fascinating discussion is worth comment. I believe that you should publish more on this issue, it may not be a taboo matter but generally people do not discuss such issues. To the next! All the best.

댓글 남기기