on 09-29-2017 9:00 AM
For Example:
I have a table employee with below fields;
EMP_ID EMP_FNAME EMP_ADDRESS EMP_CITY
----------- ------------------- ----------------------- ---------------
1 ABC USA NEW YORK
2 XYZ UK LONDON
3 MNO INDIA DELHI
Now, I want to add an ADDITIONAL columns field "EMP_LNAME" between EMP_FNAME and EMP_ADDRESS. How to do that ?
I know that, through an ALTER statement(alter table tablename ADD()) we can add, but, it will add at the last(after EMP_CITY).
A little research from your side would have provided you with the answer, as this specific question seems to come up again and again over time.
There's only one DBMS I know of that actually directly supports this operation (again, search engine usage is your friend here), but due to how relational/SQL databases work, the order of columns in tables really does not matter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply Lars 🙂
It was a question from one of my business counter part 😛
as you said, "the order of columns in tables really does not matter", your certainly right. But, he wanted to add in the middle only. Hence, I was looking any such solution exist. 🙂
At times, I felt, may be "order of the column/s is matter too.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.