Jump to content

how to change the col position of a table


shamsuljewel

Recommended Posts

shamsuljewel, there's no real good reason to have to move columns around. It doesn't really matter in RDBMS/SQL (since you can retrieve the data in any order).

 

rajivgonsalves has the right syntax to do that. That will work.

 

fenway, I don't know why you state that will not work?

 

Link to comment
Share on other sites

fenway, I don't know why you state that will not work?

It shouldn't work... it shouldn't even be allowed.

Didn't really answer my question, but oh well.

 

It works. Also, don't understand why you say it shouldn't be allowed. Basically, I don't understand where you're coming from...please elaborate (if you want).

 

 

 

Link to comment
Share on other sites

fenway, I don't know why you state that will not work?

It shouldn't work... it shouldn't even be allowed.

Didn't really answer my question, but oh well.

 

It works. Also, don't understand why you say it shouldn't be allowed. Basically, I don't understand where you're coming from...please elaborate (if you want).

 

 

 

There's no reason to do so -- just like trying to fiddle with the auto-increment counter.  It means you're trying to do something you should not ever need to do.

Link to comment
Share on other sites

There's no reason to do so -- just like trying to fiddle with the auto-increment counter.  It means you're trying to do something you should not ever need to do.

Yes, fenway, Of course I generally agree with you.

 

However, it's sometimes nice to have column data next to certain other related column data. I know, I know, all the data in a table should be related, yes; but I'm referring to something like adding a new fax number column next to a phone number column, adding a new second address column next to the main/first address column.

 

Also, it's nice to have most viewed data created in the first few columns of a table if for nothing else but to make the data easily viewable in programs such as SQLyog without having to horizontally scroll all the time.

 

Sometimes, it's just dictated by the company you're working for and their lead programmer, DBA, or architect.

 

As for changing the auto-increment value, I've had the need to change it in a development environment. I think I've had to change it once in a production environment but I can't really remember.

 

So, there's no need to move columns or change auto increment values 99% of the time folks.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.