1
ALTER TABLE
    customer
RENAME COLUMN
    dob TO birthdate date;

it threw an error.

The error body says:

Error Static analysis:

1 errors were found during analysis.

Missing comma before start of a new alter operation. (near "TO" at position 50) SQL query: Copy

ALTER TABLE customer RENAME COLUMN dob TO birthdate date

MySQL said: Documentation

#1064 - 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 'COLUMN dob TO birthdate date' at line 3

mahbuhs_redoc
  • 1,255
  • 1
  • 11
  • 25
mhasan
  • 77
  • 1
  • 8

1 Answers1

0

Use

ALTER TABLE customer CHANGE dob birthdate date;

RENAME COLUMN TO is only used to change name, and in Oracle databases.

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
kry
  • 352
  • 4
  • 13