Skip to main content
added 2 characters in body
Source Link
mustaccio
  • 26.9k
  • 24
  • 58
  • 74

INPUT:

CREATE TABLE dist
-> SELECT ST_DISTANCE(POINT(x1,y1),POINT(x2,y2))
-> FROM config;

OUTPUT:

+------------------------------------------+
| ST_DISTANCE(POINT(x1,y1) , POINT(x2,y2)) |
+------------------------------------------+
|                        140.0071426749364 |
|                       139.30183056945089 |
|                        138.6001443000692 |
|                       137.90213921473443 |
|                       137.20787149431334 |
+------------------------------------------+

RENAME COLUMN INPUT

> ALTER TABLE dist
-> RENAME COLUMN ST_DISTANCE(POINT(x1,y1),POINT(x2,y2)) TO Values;

ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(POINT(x1,y1),POINT(x2,y2)) TO Values' at line 2

ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(POINT(x1,y1),POINT(x2,y2)) TO Values' at line 2

INPUT:

CREATE TABLE dist
-> SELECT ST_DISTANCE(POINT(x1,y1),POINT(x2,y2))
-> FROM config;

OUTPUT:

+------------------------------------------+
| ST_DISTANCE(POINT(x1,y1) , POINT(x2,y2)) |
+------------------------------------------+
|                        140.0071426749364 |
|                       139.30183056945089 |
|                        138.6001443000692 |
|                       137.90213921473443 |
|                       137.20787149431334 |
+------------------------------------------+

RENAME COLUMN INPUT

> ALTER TABLE dist
-> RENAME COLUMN ST_DISTANCE(POINT(x1,y1),POINT(x2,y2)) TO Values;

ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(POINT(x1,y1),POINT(x2,y2)) TO Values' at line 2

INPUT:

CREATE TABLE dist
-> SELECT ST_DISTANCE(POINT(x1,y1),POINT(x2,y2))
-> FROM config;

OUTPUT:

+------------------------------------------+
| ST_DISTANCE(POINT(x1,y1) , POINT(x2,y2)) |
+------------------------------------------+
|                        140.0071426749364 |
|                       139.30183056945089 |
|                        138.6001443000692 |
|                       137.90213921473443 |
|                       137.20787149431334 |
+------------------------------------------+

RENAME COLUMN INPUT

> ALTER TABLE dist
-> RENAME COLUMN ST_DISTANCE(POINT(x1,y1),POINT(x2,y2)) TO Values;

ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(POINT(x1,y1),POINT(x2,y2)) TO Values' at line 2

codify sql and table
Source Link
nbk
  • 8.7k
  • 6
  • 14
  • 27

INPUT: CREATE TABLE dist -> SELECT ST_DISTANCE(POINT(x1,y1),POINT(x2,y2)) -> FROM config; OUTPUT

CREATE TABLE dist
-> SELECT ST_DISTANCE(POINT(x1,y1),POINT(x2,y2))
-> FROM config;

OUTPUT: +------------------------------------------+ | ST_DISTANCE(POINT(x1,y1) , POINT(x2,y2)) | +------------------------------------------+ | 140.0071426749364 | | 139.30183056945089 | | 138.6001443000692 | | 137.90213921473443 | | 137.20787149431334 | +------------------------------------------+ RENAME

+------------------------------------------+
| ST_DISTANCE(POINT(x1,y1) , POINT(x2,y2)) |
+------------------------------------------+
|                        140.0071426749364 |
|                       139.30183056945089 |
|                        138.6001443000692 |
|                       137.90213921473443 |
|                       137.20787149431334 |
+------------------------------------------+

RENAME COLUMN INPUT

ALTER TABLE dist -> RENAME COLUMN ST_DISTANCE(POINT(x1,y1),POINT(x2,y2)) TO Values;

> ALTER TABLE dist
-> RENAME COLUMN ST_DISTANCE(POINT(x1,y1),POINT(x2,y2)) TO Values;

ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(POINT(x1,y1),POINT(x2,y2)) TO Values' at line 2

INPUT: CREATE TABLE dist -> SELECT ST_DISTANCE(POINT(x1,y1),POINT(x2,y2)) -> FROM config; OUTPUT: +------------------------------------------+ | ST_DISTANCE(POINT(x1,y1) , POINT(x2,y2)) | +------------------------------------------+ | 140.0071426749364 | | 139.30183056945089 | | 138.6001443000692 | | 137.90213921473443 | | 137.20787149431334 | +------------------------------------------+ RENAME COLUMN INPUT

ALTER TABLE dist -> RENAME COLUMN ST_DISTANCE(POINT(x1,y1),POINT(x2,y2)) TO Values;

ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(POINT(x1,y1),POINT(x2,y2)) TO Values' at line 2

INPUT:

CREATE TABLE dist
-> SELECT ST_DISTANCE(POINT(x1,y1),POINT(x2,y2))
-> FROM config;

OUTPUT:

+------------------------------------------+
| ST_DISTANCE(POINT(x1,y1) , POINT(x2,y2)) |
+------------------------------------------+
|                        140.0071426749364 |
|                       139.30183056945089 |
|                        138.6001443000692 |
|                       137.90213921473443 |
|                       137.20787149431334 |
+------------------------------------------+

RENAME COLUMN INPUT

> ALTER TABLE dist
-> RENAME COLUMN ST_DISTANCE(POINT(x1,y1),POINT(x2,y2)) TO Values;

ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(POINT(x1,y1),POINT(x2,y2)) TO Values' at line 2

Source Link

How to rename a column name which has been created by a math function in mysql? Using ALTER TABLE is giving ERROR: 1064 (42000)

INPUT: CREATE TABLE dist -> SELECT ST_DISTANCE(POINT(x1,y1),POINT(x2,y2)) -> FROM config; OUTPUT: +------------------------------------------+ | ST_DISTANCE(POINT(x1,y1) , POINT(x2,y2)) | +------------------------------------------+ | 140.0071426749364 | | 139.30183056945089 | | 138.6001443000692 | | 137.90213921473443 | | 137.20787149431334 | +------------------------------------------+ RENAME COLUMN INPUT

ALTER TABLE dist -> RENAME COLUMN ST_DISTANCE(POINT(x1,y1),POINT(x2,y2)) TO Values;

ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(POINT(x1,y1),POINT(x2,y2)) TO Values' at line 2