10

please tell me how to place an existing column(contained values) at first position in mysql. Suppose i have a table EMP_DTLS and there are columns like NAME, SALARY, DOJ, DOB, EMAIL_ID, AND EMP_ID contains values in every columns. Now i want to place this EMP_ID at first position. enter image description here Thanks in advance.

I have tried the queries those are discussed here previously but those aren't working for me.

pinto
  • 117
  • 1
  • 1
  • 10
  • What do you mean by "first position"? You mean in a query? You can specify the order of the columns you're selecting: `SELECT emp_id, name, salary .....` etc. – Pekka Nov 24 '13 at 19:25

1 Answers1

18
ALTER TABLE EMP_DTLS MODIFY COLUMN EMP_ID INT(10) FIRST

Just use the correct type,i used INT(10)

Mihai
  • 26,325
  • 7
  • 66
  • 81