Lena Luther
Lena Luther

Reputation: 23

Change the order of the columns in mySQL

I have a Table with 5 Columns, (title, hash, story, source, time, url)...

I want that "url" is the first column... How can I do that - that the table look like

(url, title, hash, story, source, time)

Upvotes: 1

Views: 53

Answers (2)

SanduniC
SanduniC

Reputation: 41

Use this query,

ALTER TABLE tbl_name CHANGE url url VARCHAR(100) NOT NULL FIRST;
or
ALTER TABLE tbl_name MODIFY url VARCHAR(100) FIRST;

Upvotes: 1

Ümit Aparı
Ümit Aparı

Reputation: 568

Are you using phpMyAdmin? If so there's a button called "Move Columns" in the interface Image

Upvotes: 0

Related Questions