|
| ||||||||||
| Tags: alter command, columns, database, modify, tables |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| operation column positions in database
I created a table which have three columns and need to add more columns but I am unable to do it,how would I perform it an done question is also clicking in my mind that The position of the columns are managed by the way of sequence as a column name during the creation of table which is managed by database automatically.Can We change the position of the columns in the table. |
|
#2
| ||||
| ||||
| Changing the position of columns in database Changing the position of columns in database When a database table is created,it contains different columns as per the user desire that how much columns he is creating for a particular table. You are talking about the positions of the column means the table is created with 3 columns and you need to swap the sequence of columns for the table. Then it can be using ALTER SYSTEM statement or different way which you also can search within your mind using the copying or cloning of the database table. |
|
#3
| |||
| |||
| changing column positions in database Changing column positions in database Absolutely,you can change the position of the columns in the table but one thing I would like to know that why you need this concept.Whatever,you have posted and consider such a good thing. you can chnage the positiojn of columns to make the different copy of the existing table.The query to create a new column would be as follows: Code: SQL> create table New_tab as select col_3, col_0, col_1, col_2 from Prev_tab; SQL> drop table Prev_tab; SQL> rename New_tab to Prev_tab; |
|
#4
| ||||
| ||||
| Adding columns in database table Adding columns in database table To add more columns in the database tables,you need to use the ALTER command,basically the ALTER command is used to change the structure of the database object or database itself.The ALTER command associated with DDL category. To add one more column to the database table,we will do as follows: Code: ALTER TABLE Prev_tab ADD sup_name varchar2(50); |
|
#5
| ||||
| ||||
| Modifying column of table in database Modifying column of table in database: You can modify the existing column of the table.The modification of the columns seems as you can change the data type,size and overall behavior of the column. Again the ALTER command would be used to change the size and datatype of a particular column of the table but will be associated with MODIFY. Suppose,I have a table named Zachine_Contact and need to modify the contact column as a VARCHAR2 and column can contain 15 values maximum. Code: ALTER TABLE Zachine_Contact MODIFY contact VARCHAR2(15); |
|
#6
| ||||
| ||||
| Renaming column of table in database Renaming column of table in database ::: You can change the the whole structure using the ALTER statement for a database table but you can't change the name of column but another facility is provided by database,you can change it using ALTER statement but that would be associated with RENAME command and takes the following form to address itself successfully. The command to rename a column as shown: Code: ALTER TABLE table_name RENAME COLUMN old_name to new_name;
__________________ Grand Theft Auto 4 PC Video Game |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "operation column positions in database" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to get better positions in Google searches | The creeper | Technology & Internet | 3 | 20-01-2011 10:07 PM |
| How to highlight identical cell value of one column in another column? | D_chapple | Windows Software | 3 | 09-12-2009 12:11 PM |
| How to save window positions in windows 7 | Gomeler | Operating Systems | 3 | 02-12-2009 12:47 PM |
| mysql update column with another column | Gunter | Software Development | 3 | 23-05-2009 09:44 AM |
| How can I bind textbox with column in SQL database? | SushmitaP | Software Development | 3 | 19-02-2009 09:57 PM |