~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/functions/extract_date_functions.rst

  • Committer: Mark Atwood
  • Date: 2011-09-15 18:05:14 UTC
  • mfrom: (2414.5.3 update-docs)
  • Revision ID: me@mark.atwood.name-20110915180514-vii49ka3heb7gbkw
mergeĀ lp:~vjsamuel/drizzle/more-doc-fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
 
73
73
*Result: 20*
74
74
 
75
 
microseconds
76
 
^^^^^^^^^^^^
77
 
 
78
 
.. code-block:: mysql
79
 
 
80
 
        SELECT EXTRACT(MICROSECONDS FROM TIME '17:12:28.5');
81
 
 
82
 
The seconds field, including fractional parts, multiplied by 1 000 000; note that this includes full seconds
83
 
 
84
 
*Result: 28500000*
85
 
 
86
75
minute
87
76
^^^^^^
88
77
 
140
129
        
141
130
*Result: 27*
142
131
 
143
 
.. code-block:: mysql
144
 
 
145
 
        SELECT EXTRACT(SECOND FROM TIME '08:15:22.5');
146
 
 
147
 
*Result: 22.5*
148
 
 
149
132
timezone
150
133
^^^^^^^^
151
134
 
175
158
 
176
159
*Result: 2009*
177
160
 
178
 
date_part
179
 
^^^^^^^^^
180
 
 
181
 
The valid field names for date_part are the same as for extract.
182
 
 
183
 
.. code-block:: mysql
184
 
 
185
 
        SELECT date_part('day', TIMESTAMP '2010-07-16 10:12:05');
186
 
 
187
 
*Result: 16*
188
 
 
189
 
.. code-block:: mysql
190
 
 
191
 
        SELECT date_part('hour', INTERVAL '5 hours 12 minutes');
192
 
 
193
 
*Result: 4*