![background image](http://html1.mh-extra.com/html/oracle/5-0/5-0_reference-manual_1646196996.webp)
Spatial Extensions
976
The select list extension also applies to
ORDER BY
. That is, you can refer to nonaggregated columns in
the
ORDER BY
clause that do not appear in the
GROUP BY
clause. (However, as mentioned previously,
ORDER BY
does not affect which values are chosen from nonaggregated columns; it only sorts them
after they have been chosen.) This extension does not apply if the
ONLY_FULL_GROUP_BY
[538]
SQL
mode is enabled.
In some cases, you can use
MIN()
[971]
and
MAX()
[971]
to obtain a specific column value even
if it is not unique. If the
sort
column contains integers no larger than 6 digits, the following query gives
the value of
column
from the row containing the smallest
sort
value:
SUBSTR(MIN(CONCAT(LPAD(sort,6,'0'),column)),7)
See
Section 3.6.4, “The Rows Holding the Group-wise Maximum of a Certain Column”
.
If you are trying to follow standard SQL, you cannot use expressions in
GROUP BY
clauses. As a
workaround, use an alias for the expression:
SELECT id, FLOOR(value/100) AS val
FROM
tbl_name
GROUP BY id, val;
MySQL permits expressions in
GROUP BY
clauses, so the alias is unnecessary:
SELECT id, FLOOR(value/100)
FROM
tbl_name
GROUP BY id, FLOOR(value/100);
12.16. Spatial Extensions
MySQL supports spatial extensions to enable the generation, storage, and analysis of geographic
features. Before MySQL 5.0.16, these features are available for
MyISAM
tables only. As of MySQL
5.0.16,
InnoDB
,
NDB
,
BDB
, and
ARCHIVE
also support spatial features.
For spatial columns,
MyISAM
supports both
SPATIAL
and non-
SPATIAL
indexes. Other storage
engines support non-
SPATIAL
indexes, as described in
Section 13.1.8, “
CREATE INDEX
Syntax”
.
This chapter covers the following topics:
• The basis of these spatial extensions in the OpenGIS geometry model
• Data formats for representing spatial data
• How to use spatial data in MySQL
• Use of indexing for spatial data
• MySQL differences from the OpenGIS specification
Additional Resources
• The Open Geospatial Consortium publishes the OpenGIS® Simple Features Specifications For
SQL, a document that proposes several conceptual ways for extending an SQL RDBMS to support
spatial data. This specification is available from the OGC Web site at
http://www.opengis.org/
docs/99-049.pdf
.
• If you have questions or concerns about the use of the spatial extensions to MySQL, you can discuss
them in the GIS forum:
http://forums.mysql.com/list.php?23
.
12.16.1. Introduction to MySQL Spatial Support
MySQL implements spatial extensions following the specification of the Open Geospatial Consortium
(OGC). This is an international consortium of more than 250 companies, agencies, and universities
participating in the development of publicly available conceptual solutions that can be useful
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...