Search
 
SCRIPT & CODE EXAMPLE
 

SQL

change name of colum in sql table

ALTER TABLE "table_name" RENAME COLUMN "column 1" TO "column 2";
Comment

change column name in sql

MySQL:
ALTER TABLE Customer CHANGE Address Addr char(50);

Oracle:
ALTER TABLE Customer RENAME COLUMN Address TO Addr;
Comment

how to change column name in sql

ALTER TABLE Student RENAME COLUMN NAME TO FIRST_NAME;
ALTER TABLE `Table Name` MODIFY COLUMN `Column Name` Datatype(Size);
Comment

how to change a collumn name in sql

ALTER TABLE `table_name` 
CHANGE `old_name` `new_name` VARCHAR(10) 
CHARACTER SET utf8 
COLLATE utf8_general_ci NULL 
DEFAULT NULL;
Comment

modify column name in sql

ALTER TABLE `Table Name` MODIFY COLUMN `Column Name` Datatype(Size);
Comment

rename column in table sql

ALTER TABLE table_name
RENAME COLUMN old_name TO new_name;
Comment

SQL Rename Column in a Table

ALTER TABLE Customers
RENAME COLUMN customer_id TO c_id;
Comment

rename column in table sql

ALTER TABLE "table_name"
Change "column 1" "column 2" ["Data Type"];
Comment

change column name sql

ALTER TABLE `db_name`.`table_name` 
	CHANGE `current_column_name` `new_column_name` datatype(size) NOT NULL COMMENT '';
Comment

sql change column name based on value

SELECT CASE lower(col1)
	WHEN 'agree' THEN 'Ok'
    ELSE
        CASE 
            WHEN col2 = 1 THEN 'Ko'
            ELSE 'Maybe'
        END
END AS my_result
FROM table_name;
Comment

changing column names in sql query results

SELECT NAME AS "Employee Name" FROM PEOPLE;

SELECT p.NAME AS "Employee Name", s.SALARY AS "Employee Salary"
FROM PEOPLE p
JOIN SALARIES s ON p.ID = s.ID;
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql case when null 
Sql :: group by 15 minute interval sql server 
Sql :: mysql return if it contains 
Sql :: how to get the ddl for datafile in oracle tablespace 
Sql :: how to install mysql server on centos 7 
Sql :: how to see all table partition in oracle 
Sql :: mysql smallint range 
Sql :: mysqldump password 
Sql :: add created and updatedAt fields in mysql 
Sql :: sql get number of days between two dates 
Sql :: sql server check table exists 
Sql :: mysql select utc time in eastern time 
Sql :: sql remove non numeric characters 
Sql :: sql fill na with 0 
Sql :: get first 3 letters name in sql 
Sql :: mysql delete 
Sql :: postgres describe query 
Sql :: mysql select where not in multiple tables 
Sql :: alter table oracle 
Sql :: oracle grant select on schema 
Sql :: getting next sequence value jpa postgress 
Sql :: org.h2.jdbc.jdbcsqlsyntaxerrorexception table not found 
Sql :: mysql to lowercase 
Sql :: oracle sysdate - 1 month 
Sql :: update with join sql server 
Sql :: insert a select statement into a table 
Sql :: mysql select another database 
Sql :: sql create a new table 
Sql :: mysql current date 
Sql :: sqlite3 show columns name 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =