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

SRJ
  • 2,092
  • 3
  • 17
  • 36
mhasan
  • 87
  • 1
  • 10

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
  • 732,580
  • 175
  • 1,330
  • 1,459
kry
  • 362
  • 3
  • 13