Search
 
SCRIPT & CODE EXAMPLE
 

SQL

alter table add multiple columns postgresql


        
            
        
     ALTER TABLE customer 
ADD COLUMN fax VARCHAR,
ADD COLUMN email VARCHAR;
Comment

postgres update multiple columns

UPDATE table_name 
SET column_one = TRUE,
    column_two = 'some string',
    column_three = 558,
WHERE column_four = 'some other string'
Comment

postgre multiple update query

update users as u set -- postgres FTW
  email = u2.email,
  first_name = u2.first_name,
  last_name = u2.last_name
from (values
  (1, 'hollis@weimann.biz', 'Hollis', 'Connell'),
  (2, 'robert@duncan.info', 'Robert', 'Duncan')
) as u2(id, email, first_name, last_name)
where u2.id = u.id;
Comment

update multiple columns in postgres

postgres=# update sales 
           set order_date='2020-12-04', 
               amount=250 where id=3;

postgres=# select * from sales;
id | order_date | amount
----+------------+--------
1 | 2020-12-01 | 100
2 | 2020-12-02 | 250
3 | 2020-12-04 | 250
UPDATE 1
Comment

PREVIOUS NEXT
Code Example
Sql :: sql right join with where clause 
Sql :: rename table sqlite 
Sql :: truncate all tables 
Sql :: date in oracle 
Sql :: oracle index hint 
Sql :: create table in sql server 
Sql :: mysql execute file 
Sql :: oracle sql copy table without data 
Sql :: mysqlclient error 
Sql :: mysql date equals to current_date plus days 
Sql :: if column value is null then in mysql 
Sql :: get all columns in a table sql 
Sql :: add comma after 3 digits select sql 
Sql :: T-SQL - Delete Column 
Sql :: WHERE not regex in SQL 
Sql :: tinydb add table 
Sql :: pgsql is not permitted to log in 
Sql :: sql view talbe columns 
Sql :: mysql function 
Sql :: date sql 
Sql :: sql get first letter of string 
Sql :: update in sql server table 
Sql :: postgresql if else endif 
Sql :: mysql add columns 
Sql :: how to create a table structure from another table in mysql 
Sql :: import mysql database command line linux 
Sql :: stuff sql server 
Sql :: postgres windows import dump 
Sql :: read xml in sql server 
Sql :: sql latlng 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =