File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 1- <!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.56 2007/02/01 00:28:16 momjian Exp $ -->
1+ <!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.57 2007/02/20 14:34:25 momjian Exp $ -->
22
33<sect1 id="arrays">
44 <title>Arrays</title>
@@ -243,18 +243,14 @@ SELECT schedule[1:2][1:1] FROM sal_emp WHERE name = 'Bill';
243243(1 row)
244244</programlisting>
245245
246- We could also have written:
246+ If any dimmension is written as a slice, i.e contains a colon, then all
247+ dimmensions are treated as slices. If a dimmension is missing, it is
248+ assumed to be <literal>[1:1]</>. If a dimmension has only a single
249+ number (no colon), that dimmension is treated as being from <literal>1</>
250+ to the number specified. For example, <literal>[2]</> is treated as
251+ <literal>[1:2], as in this example:
247252
248253<programlisting>
249- SELECT schedule[1:2][1] FROM sal_emp WHERE name = 'Bill';
250- </programlisting>
251-
252- with the same result. An array subscripting operation is always taken to
253- represent an array slice if any of the subscripts are written in the form
254- <literal><replaceable>lower</replaceable>:<replaceable>upper</replaceable></literal>.
255- A lower bound of 1 is assumed for any subscript where only one value
256- is specified, as in this example:
257- <programlisting>
258254SELECT schedule[1:2][2] FROM sal_emp WHERE name = 'Bill';
259255
260256 schedule
You can’t perform that action at this time.
0 commit comments