On Thu, Dec 24, 2015 at 6:49 AM, gunnar <gharms at hiqinvest.nl> wrote:
> I would like a less limited 'alter table' statement, to be able to drop > columns and to add columns at a position of my own choice instead of always > at the end. > > ?I'm curious as to why. Doing so would, most likely, require rewriting the entire table. If you want a SELECT * to get the columns in a particular order, just create a VIEW with the columns in the order in which you want them. The SQL standard, I'm fairly sure, doesn't even specify the "natural order" of the column returned in a "SELECT *". Of course, they will likely always be return in the "natural" order. But that depends on how the back end is programmed. I could see a vendor (as unlikely as it would be) deciding to return the column in a "SELECT *" in lexicographical order based on the server's code page, or the table's default code page, or perhaps even in the client's code page. But then, I admit that I am "anal" about my SELECT statements; at least when embedded in a program. IMO, "SELECT *" is a very bad idea in any programming language. As is making any assumption about the order of rows returned when an ORDER BY is not specified. "Assuming _nothing_, other than the worst." is my programming motto. Or the Russian: "Trust, but verify!". Especially if it is coming in from "meatware" (people), or some other organization. We have a process at work which consistently blows up because the end user sends us junk. E.g. the cost is q.97 dollars, instead of 1.97 (q is below 1 and user is typing fast). === Hoping you have a nice Christmas, Hanukkah, Fetivus, Kwanza, or at least a 3 day week end. -- Computer Science is the only discipline in which we view adding a new wing to a building as being maintenance -- Jim Horning Schrodinger's backup: The condition of any backup is unknown until a restore is attempted. Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be. He's about as useful as a wax frying pan. 10 to the 12th power microphones = 1 Megaphone Maranatha! <>< John McKown