DHJJ [Hatsune's Journal Japan] blog

Hatsune's Journal Japan blog

目次

Blog 利用状況

ニュース

最新ツイート

運営サイト

Hatsune's Journal Japan
DHJJ

著作など

資格など

MVP
Microsoft MVP for Visual Basic
(April 2008 - March 2015)

ACE
OCP
MCP

書庫

日記カテゴリ

わんくま同盟

【Oracle】日付関連のSQL

 Database 10g Enterprise Edition Release 10.2.0.3.0 - Production 
With the Partitioning, OLAP and Data Mining options 
に接続されました。 
SQL> ALTER SESSION SET NLS_DATE_FORMAT='YYYY/MM/DD HH24:MI:SS'; 

セッションが変更されました。 

SQL> 
SQL> SELECT '1年後',SYSDATE,ADD_MONTHS(TRUNC(SYSDATE),12) FROM DUAL; 

'1年 SYSDATE ADD_MONTHS(TRUNC(SY 
------ ------------------- ------------------- 
1年後 2009/01/15 13:48:05 2010/01/15 00:00:00 

SQL> SELECT '1ヶ月後',SYSDATE,ADD_MONTHS(TRUNC(SYSDATE), 1) FROM DUAL; 

'1ヶ月 SYSDATE ADD_MONTHS(TRUNC(SY 
-------- ------------------- ------------------- 
1ヶ月後 2009/01/15 13:48:05 2009/02/15 00:00:00 

SQL> SELECT '1日後',SYSDATE,TRUNC(SYSDATE)+1 FROM DUAL; 

'1日 SYSDATE TRUNC(SYSDATE)+1 
------ ------------------- ------------------- 
1日後 2009/01/15 13:48:05 2009/01/16 00:00:00 

SQL> SELECT '1時間後',SYSDATE,SYSDATE+1/24 FROM DUAL; 

'1時間 SYSDATE SYSDATE+1/24 
-------- ------------------- ------------------- 
1時間後 2009/01/15 13:48:05 2009/01/15 14:48:05 

SQL> SELECT '1分後',SYSDATE,SYSDATE+1/1440 FROM DUAL; 

'1分 SYSDATE SYSDATE+1/1440 
------ ------------------- ------------------- 
1分後 2009/01/15 13:48:05 2009/01/15 13:49:05 

SQL> SELECT '1秒後',SYSDATE,SYSDATE+1/86400 FROM DUAL; 

'1秒 SYSDATE SYSDATE+1/86400 
------ ------------------- ------------------- 
1秒後 2009/01/15 13:48:05 2009/01/15 13:48:06 

SQL> SELECT '明日9時',SYSDATE,TRUNC(SYSDATE)+1+9/24 FROM DUAL; 

'明日9 SYSDATE TRUNC(SYSDATE)+1+9/ 
-------- ------------------- ------------------- 
明日9時 2009/01/15 13:48:05 2009/01/16 09:00:00 

SQL> SELECT '来月1日',SYSDATE,LAST_DAY(TRUNC(SYSDATE))+1 FROM DUAL; 

'来月1 SYSDATE LAST_DAY(TRUNC(SYSD 
-------- ------------------- ------------------- 
来月1日 2009/01/15 13:48:05 2009/02/01 00:00:00 

SQL> SELECT '今月1日',SYSDATE,TRUNC(SYSDATE,'MM') FROM DUAL; 

'今月1 SYSDATE TRUNC(SYSDATE,'MM') 
-------- ------------------- ------------------- 
今月1日 2009/01/15 13:48:05 2009/01/01 00:00:00 

SQL>

1年後 ADD_MONTHS(TRUNC(SYSDATE),12)
1ヵ月後 ADD_MONTHS(TRUNC(SYSDATE), 1)
1時間後 SYSDATE+1/24
1分後 SYSDATE+1/1440
1秒後 SYSDATE+1/86400
明日9時 TRUNC(SYSDATE)+1+9/24
来月1日 LAST_DAY(TRUNC(SYSDATE))+1
今月1日 TRUNC(SYSDATE,'MM')

投稿日時 : 2009年1月18日 19:50

Feedback

# re: 【Oracle】日付関連のSQL 2009/01/19 14:24 こあら

「来月1日」を今月1日にADD_MONTHSを噛ませた書き方にすると、
先月とか翌々月でも字面が揃ってイイかも。
> TRUNC(ADD_MONTHS(SYSDATE, 1),'MM')

# KeIcKshEYK 2011/10/22 22:27 http://www.discountwatchstore.com/Casio-G-Shock_c_

Of course, I understand a little about this post but will try cope with it!!...

# nLvAlfhcbwf 2011/11/02 6:23 http://optclinic.com/

Yeah, it is clear now !... From the very beginning I did not understand where was the connection with the title !!...

# QljDmhviMLNlbLZegep 2011/11/02 9:41 http://travelimagehosting.com/

Are you interested in webmaster`s income?!...

# cPCDVizuarunXpOG 2011/11/09 19:32 http://www.buylasix.biz

Author, Shoot yourself a knee..!

# qOCeysCXpT 2011/11/16 2:59 http://circalighting.com/designer_products.aspx?di

Hello! Read the pages not for the first day. Yes, the connection speed is not good. How can I subscribe? I would like to read you in the future!...

# eSTekPJDtEkV 2011/11/16 4:00 http://www.laurenslinens.com/thomasbedding.html

Received the letter. I agree to exchange the articles.

# nike schuhe selber gestalten 2012/11/17 16:21 http://www.nikeschuheherrende.com/

A toughest way to miss out on someone you care about will be session best adjacent to these businesses bearing in mind you possibly can‘longer you can keep them.
nike schuhe selber gestalten http://www.nikeschuheherrende.com/

# nike free 2012/11/18 23:36 http://www.nikefreerunherrenfrauen.com/

Assume‘MT spend your labour over guy/woman,what person isn‘MT prepared to spend his moment you.
nike free http://www.nikefreerunherrenfrauen.com/

# Pull Gucci 2012/11/25 18:39 http://www.fr-marque.com/

Rarely ever lower, if may unfortunate, do it yourself can never predict who is responsible for cascading fond of your actual laugh.
Pull Gucci http://www.fr-marque.com/

# casquette superman 2013/03/14 0:51 http://www.b77.fr/

Will be last the moment each single buddy thinks brand-new areas such as hook brilliance all over the various. casquette superman http://www.b77.fr/

# casquette obey 2013/03/14 5:08 http://www.b44.fr/

Friends for which you choose equipped with items rrs going to be bought from everyone. casquette obey http://www.b44.fr/

# pari street 2013/03/15 18:16 http://www.a88.fr/

Accord is going to be Coptis groenlandica that scarves the entire spirits with all the self-proclaimed community. pari street http://www.a88.fr/

# chaussea 2013/04/07 2:11 http://ruemee.com/

Real love is simply imperfect through arrival, but it really really evolves more robust as we age if at all as it should be raised on. chaussea http://ruemee.com/

# zrARSQKZhFCkihC 2014/08/28 1:39 http://crorkz.com/

kV8Hcr Excellent post however I was wondering if you could write a litte more on this topic? I'd be very thankful if you could elaborate a little bit further. Cheers!

# kIlqPCgrQW 2014/08/29 10:56 http://www.fastinsuranceagents.com

Great, thanks for sharing this blog post.Thanks Again. Much obliged.

# XZzFwQeASaoVlkpZ 2014/08/29 20:01 http://criminallawyersottawa.com

I've read a few good stuff here. Certainly worth bookmarking for revisiting. I surprise how much effort you put to create such a fantastic informative site.

# dhulXHRXwyDRyJEz 2014/08/30 21:15 http://facebook.com/pages/Flyttfirma-i-Stockholm/5

I was suggested this blog by my cousin. I'm not sure whether this post is written by him as nobody else know such detailed about my difficulty. You are incredible! Thanks!

# ePOqwGwobpwWEgOVt 2014/08/30 22:28 http://www.m88so.com/Main/Home.aspx?affiliateId=97

Hmm is anyone else having problems with the pictures on this blog loading? I'm trying to determine if its a problem on my end or if it's the blog. Any feedback would be greatly appreciated.

# vSldMrbdHmlBPDbbJ 2014/09/01 21:57 https://kupayedili.com

Very neat blog post.Much thanks again. Want more.

# QwKoYJhzWnBB 2014/09/02 16:40 http://taqwa.info/story.php?id=26868

Thanks a lot for the blog. Much obliged.

# pyDdROJYleSbOAcVE 2014/09/02 17:35 http://www.figarodigital.co.uk/Mobile/oakley2.htm

Hey, you used to write excellent, but the last several posts have been kinda boring??? I miss your great writings. Past few posts are just a little out of track! come on!

# XknVfCyitGsttkWj 2014/09/02 18:56 http://www.botaniquebartley.info/

I'm not sure why but this website is loading very slow for me. Is anyone else having this problem or is it a problem on my end? I'll check back later and see if the problem still exists.

# IqrkHVZnaj 2014/09/02 20:14 https://www.youtube.com/watch?v=KLiKPsOc22A

you are really a good webmaster. The website loading speed is amazing. It seems that you're doing any unique trick. Also, The contents are masterpiece. you've done a wonderful job on this topic!

# BUZtLpgYyGxdh 2014/09/02 21:27 http://www.m88so.com/Main/Home.aspx?affiliateId=97

Thanks for sharing, this is a fantastic blog article.Thanks Again. Really Great.

# elmEIIthKMnQqzPClp 2014/09/03 3:48 http://www.kutsenko.ru/forum/index.php?showuser=43

Very informative blog article.Thanks Again. Really Great.

# DRjRqPjBhbvFiOgMaTM 2014/09/03 7:33 http://www.huriyebilisik.com/members/groove3534/ac

Im grateful for the post.Really looking forward to read more. Fantastic.

# VnhXpfPUSHrdCVdIM 2014/09/03 8:43 http://imx.tw/4qJ

I truly appreciate this post. Really Great.

# tHUWyvzjlQMeZ 2014/09/03 19:52 https://www.youtube.com/watch?v=ietNoQGnfas

Hmm is anyone else experiencing problems with the pictures on this blog loading? I'm trying to determine if its a problem on my end or if it's the blog. Any responses would be greatly appreciated.

# qFQcWmpXkqo 2014/09/05 19:56 http://pauses.ru/memberlist.php?mode=viewprofile&a

Enjoyed every bit of your article.Thanks Again. Keep writing.

# vjaBbZwJABXMIiJ 2014/09/05 23:24 https://www.youtube.com/watch?v=bmyZcX8nn50

What's Happening i'm new to this, I stumbled upon this I have found It absolutely useful and it has aided me out loads. I hope to contribute & help other users like its aided me. Good job.

# VRGzuARPhPbjDpcT 2014/09/06 19:56 http://www.campusspage.com

You made some good points there. I did a search on the subject matter and found most persons will go along with with your website.

# XZQkZDnkMZHbPTSP 2014/09/06 20:35 http://knifesetreview.com/

I really enjoy the article.Thanks Again. Want more.

# NYpvWDaiDDXmPCkM 2014/09/06 23:39 http://kitchenwareutensils.com/

Im obliged for the blog article.Much thanks again. Will read on...

# evHKGBYWpHc 2014/09/08 15:56 http://videocaption.info/story.php?id=28144

Thanks again for the blog post.Thanks Again. Awesome.

# tyKhvlGLnntKy 2014/09/08 17:29 http://vip-statusi.ru/user/ncecyeeoproyoc/

Very informative blog. Will read on...

# iTyGRMfvpozAkO 2014/09/08 19:52 http://www.m88so.com/Main/Home.aspx?affiliateId=97

Thanks so much for the blog article.Really looking forward to read more. Really Great.

# pphoPijYNfeMTvVd 2014/09/08 23:32 https://www.youtube.com/watch?v=mSbbytrVLHY

Spot on with this write-up, I truly think this web site wants much more consideration. I'll in all probability be again to learn much more, thanks for that info.

# BgvtHJZGXBlQoeMIah 2014/09/09 2:14 http://fbb15ofi0baraq7hhb4jnjpw7s.hop.clickbank.ne

I really like and appreciate your article.Much thanks again.

# JTHKidwUbrqGGUplboy 2014/09/09 5:42 http://www.fiverr.com/hgmservice/do-terra-nuclear-

Fantastic blog.Much thanks again. Fantastic.

# AkwkdGNhjD 2014/09/09 7:54 http://ecommerce-investments.com/

Wow, great article post.Really looking forward to read more. Will read on...

# rbnjiiQeQw 2014/09/09 9:27 http://ecommerce-for-business.com/luis-souto/

Great post.Really looking forward to read more. Great.

# khVIoObAwx 2014/09/09 12:33 http://vente-sur-internet.com/luis-souto/

I am continuously searching online for ideas that can aid me. Thx!

# TcXvREyxDnSDWIyH 2014/09/09 17:31 http://Viralfusion.com

I do not even know how I ended up here, but I thought this post was good. I do not know who you are but certainly you are going to a famous blogger if you aren't already ;) Cheers!

# azbiEbKrZYsaTD 2014/09/09 17:51 http://pisifoto.com/index.php?id=362&tx_photob

Thanks a lot for the blog post.Really looking forward to read more. Fantastic.

# WENrtzAjpZcljeCv 2014/09/09 19:15 http://www.arrasproperties.com/category/properties

I have fun with, result in I found exactly what I used to be having a look for. You've ended my four day long hunt! God Bless you man. Have a great day. Bye

# rMzUMOsCRvJmVWwDqDW 2014/09/09 19:24 http://suhinichi.moy.su/index/8-11415

Im obliged for the article post.Much thanks again.

# MwDpPeyhscyHVloxoq 2014/09/09 21:27 http://www.designingdigitally.com

Wonderful work! That is the type of info that should be shared across the internet. Disgrace on Google for not positioning this submit higher! Come on over and visit my website . Thanks =)

# dEtqyBxAaJyQzo 2014/09/10 1:58 https://www.etsy.com/shop/AfurakanArt

Thanks so much for the blog post.Thanks Again. Much obliged.

# ceAWUixSRUMKKfRvnJ 2014/09/10 19:55 http://www.arrasproperties.com

wow, awesome article.Really looking forward to read more. Fantastic.

# WdKqpXKpUOHp 2014/09/10 20:35 http://www.canadanobis.com

you are really a good webmaster. The site loading speed is amazing. It seems that you're doing any unique trick. Also, The contents are masterwork. you have done a wonderful job on this topic!

# cpLNweeiGyxQuF 2014/09/11 2:19 http://www.uboomerutv.com/uprofile.php?UID=450727

Very neat blog post.Really looking forward to read more. Really Great.

# tjMREYWVQUCZiqtuzPO 2014/09/11 16:36 http://www.playedonline.com/users/sister4bead

This is one awesome blog. Keep writing.

# dNGrFLhWfgjEFpmo 2014/09/11 19:08 http://optimiseonline.com.au/

magnificent post, very informative. I'm wondering why the opposite experts of this sector don't understand this. You must proceed your writing. I'm confident, you have a huge readers' base already!

# ZzLWfePAQuOB 2014/09/11 19:47 http://wiki.shol.ru/index.php?title=Anime_Tips_on_

I really like and appreciate your article post.Thanks Again. Fantastic.

# CTWIbePHoNxUOvh 2014/09/11 21:10 http://viralquake.com/category/babies/

Thanks for sharing, this is a fantastic post.Much thanks again. Awesome.

# xoWbPjzbSbaY 2014/09/12 3:30 http://www.phpbbplanet.com/aguinaldohighsc/profile

I am so grateful for your post. Fantastic.

# RGyRPOJVrpsUUdC 2014/09/12 18:53 http://www.myfilmebi.net/user/nedrcegpepaagu/

Major thanks for the blog post.Much thanks again. Want more.

# VjbEpUSiJSkKJriog 2014/09/13 7:29 https://www.etsy.com/shop/AfurakanArt

I will immediately grab your rss as I can't find your email subscription link or newsletter service. Do you've any? Please let me know so that I could subscribe. Thanks.

# BxbFlzvMHtYuKedZB 2014/09/13 8:25 http://www.marshallspetzone.com

I really liked your article post.Much thanks again. Awesome.

# iYZpyNjxLJBdSx 2014/09/13 16:41 https://www.youtube.com/edit?video_id=CSuUco_72Vs

you are really a good webmaster. The website loading speed is incredible. It seems that you are doing any unique trick. Also, The contents are masterpiece. you've done a excellent job on this topic!

# jswyxDhlnVA 2014/09/14 18:14 http://www.escortsinlondon.tv/

Hi, i think that i saw you visited my weblog thus i came to ???return the favor???.I am trying to find things to improve my website!I suppose its ok to use some of your ideas!!

# DVOWApGonSrQzjgQZH 2014/09/14 20:00 http://distancity.com/

I've read a few good stuff here. Certainly worth bookmarking for revisiting. I wonder how much effort you put to make such a wonderful informative site.

# sPTkolDcOJ 2014/09/14 22:56 http://www.Paulo-blog.com

Im obliged for the post.Really looking forward to read more. Will read on...

# TshvvdFhuRX 2014/09/15 2:42 http://www.cantpayloan.com

A round of applause for your article post.Really looking forward to read more. Much obliged.

# mhNAWFyXJfQy 2014/09/15 9:15 http://www.theboatonlinestore.co.uk/

whoah this weblog is magnificent i like reading your articles. Keep up the good paintings! You understand, lots of persons are searching around for this info, you could help them greatly.

# lkEdBorEOwnD 2014/09/15 17:59 https://www.youtube.com/watch?v=TwvstEk_Ljg

I value the post.

# XBQpIbgOaRRbfG 2014/09/15 18:43 http://pravoslavie.kharkov.ua/user/gaubiionrngpuc/

I appreciate you sharing this blog article.Much thanks again. Really Great.

# iuXTmRLPpxzGhIUQsQc 2014/09/15 21:27 http://www.youtube.com/watch?v=5nzvSvzYFfA

Great, thanks for sharing this blog article.Much thanks again. Keep writing.

# aitZqZcHiusdiXIjBqj 2014/09/16 17:57 https://www.youtube.com/watch?v=6BlpsZ7LHRQ

I've been absent for a while, but now I remember why I used to love this web site. Thanks , I'll try and check back more frequently. How frequently you update your website?

# zWkiiUEzpgF 2014/09/16 23:44 http://giveaways.xyz

I really enjoy the blog article.Really looking forward to read more. Really Great.

# hYVNomVTrCLYtAgfMo 2014/09/17 16:59 http://www.challengethemagician.com

Major thanks for the post.Really looking forward to read more. Really Great.

# EDPmVBSzaebxtXqEuc 2014/09/18 1:20 http://bengoshi-japan.net/?p=22059

Thanks-a-mundo for the blog article.Thanks Again. Awesome.

# mQbOpLRjToruq 2014/09/18 1:58 http://topmountaintravel.org/story.php?id=36307

Really enjoyed this article post.Really looking forward to read more. Will read on...

# ztgTfhmTHDTdC 2014/09/18 3:08 http://www.fbhexa.com

I truly appreciate this blog.Really looking forward to read more. Want more.

# KqJOxPiRDxqEajDjLhV 2014/09/18 16:24 http://www.nsor.com

Very informative post.Really looking forward to read more.

# KOAodqlRLx 2014/09/18 18:13 http://www.boevi4ok.ru/user/acicninpnonybb/

Great article. Much obliged.

# RAjSoGnhlgxkGfYiVe 2014/09/18 19:21 http://www.youtube.com/watch?v=xIl35cOJb9A

I'd must test with you here. Which is not something I often do! I get pleasure from reading a publish that will make folks think. Additionally, thanks for allowing me to remark!

# CLmSpqjvajUoLJpLptY 2014/09/18 19:48 https://www.youtube.com/watch?v=YLPGYphyJ2s

Really informative post. Fantastic.

# DSrVBqCjgAA 2014/09/18 23:13 http://youtu.be/9im_Z9iN_XA

Thanks for sharing, this is a fantastic blog article. Much obliged.

# zDpTUXKcrB 2014/09/19 2:38 http://youtu.be/7lk3vY5lqww

Great, thanks for sharing this article.Thanks Again. Fantastic.

タイトル  
名前  
Url
コメント