SAK }‘ŠŲ

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠŲEƒJƒtƒF ˆę—— SAK Streets ŒŸõ
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

MySQL •Ō16 - “ú•tŠÖ”AƒVƒXƒeƒ€“ú•tAØŽĖA“ú•t·A“ú•t‰ÁŽZA‘ŽŪ

ĄƒVƒXƒeƒ€“ú•tAƒVƒXƒeƒ€ŽžŠÔ

  Ecurrent_timestamp() ŠÖ”‚́AƒVƒXƒeƒ€“ú•t(ƒT[ƒo“ú•t) ‚ð•Ô‚·B

select current_date;

+--------------+
| current_date |
+--------------+
| 2003-05-29   |
+--------------+

select current_time;

+--------------+
| current_time |
+--------------+
| 20:48:35     |
+--------------+

select current_timestamp;

+---------------------+
| current_timestamp   |
+---------------------+
| 2003-05-29 20:48:47 |
+---------------------+

select now();

+---------------------+
| now()               |
+---------------------+
| 2003-05-29 20:49:01 |
+---------------------+

select date_format(now(), '%y.%m.%d');

+--------------------------------+
| date_format(now(), '%y.%m.%d') |
+--------------------------------+
| 03.05.29                       |
+--------------------------------+

select date_format(now(), '%Y.%m.%d');

+--------------------------------+
| date_format(now(), '%Y.%m.%d') |
+--------------------------------+
| 2003.05.29                     |
+--------------------------------+

Ą“ú•tØ‚čŽĖ‚Ä

  Etruncate ‚ł̓Gƒ‰[‚É‚Č‚é‚Ė‚ŁAŽĐM‚Í‚Č‚Ē‚ŠŽŸ‚Ė‚æ‚Ī‚ČŠī‚ķ‚Å‘ã‘Ö‚Ķ‚Å
    ‚Ŧ‚Č‚Ē‚ą‚Æ‚ā‚Č‚Ē‚ЂȁB(^^;

select cast(substring(now(), 1, 10) as date);

+---------------------------------------+
| cast(substring(now(), 1, 10) as date) |
+---------------------------------------+
| 2003-05-29                            |
+---------------------------------------+

Ą“ú•t‚Ė· (“ú•tŠÔŠuA“ú•t”͈Í)

  Eto_days() ‚ð‚Ī‚Ü‚­—˜—p‚·‚éB
    (“ú•tŒvŽZA“ú”ŒvŽZAƒJƒŒƒ“ƒ_[ŒvŽZ)

select to_days(now()) - to_days('2003-05-27 00:00:00');

+-------------------------------------------------+
| to_days(now()) - to_days('2003-05-27 00:00:00') |
+-------------------------------------------------+
|                                               2 |
+-------------------------------------------------+

Ą“ú•t‚Ė‰ÁŽZ

  Edate_add ‚ðŽg—p‚·‚éB
    (“ú•tŒvŽZA“ú”ŒvŽZAƒJƒŒƒ“ƒ_[ŒvŽZ)

select date_add(now(), interval 3 day);

+---------------------------------+
| date_add(now(), interval 3 day) |
+---------------------------------+
| 2003-06-01 21:12:06             |
+---------------------------------+

ĄŽŸ‚Ė—j“ú

  E‚­‚Ī[A‚í‚Đ‚ņ‚Č‚ĒB(^^;

ĄŒŽ––“ú

  E‚­‚Ī[A‚í‚Đ‚ņ‚Č‚ĒB(^^;

Ą“ú•tŒ^‚Ö•ÏŠ·(‘ŽŪ•ÏŠ·A“ú•t•ÏŠ·)

  E‚ ‚Ü‚čˆÓŽŊ‚·‚é•K—v‚Š‚Č‚Ē‚Đ‚ā‚ĩ‚ę‚Č‚ĒB

select concat(now(), ' test');

+--------------------------+
| concat(now(), ' test')   |
+--------------------------+
| 2003-05-29 21:25:43 test |
+--------------------------+

ĄŒ^•ÏŠ·

  E‚ ‚Ü‚čˆÓŽŊ‚·‚é•K—v‚Š‚Č‚Ē‚Đ‚ā‚ĩ‚ę‚Č‚ĒB

ĄMySQL •ŌŽ‘—ŋ
ĄPostgreSQL •ŌAJAVA ServletAJSP •ŌŽ‘—ŋ
ĄSQL Šî‘b•ŌŽ‘—ŋ
ĄSQL Šî‘bŽĀ’n•ŌŽ‘—ŋ
ĄSQL ƒ`ƒ…[ƒjƒ“ƒO•ŌŽ‘—ŋ
ĄOracle PL/SQL •ŌŽ‘—ŋ
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠŲEƒJƒtƒF ˆę—— SAK Streets ŒŸõ



Copyright (C) 1999-2017 Y.SAK