PHP Tutorials
- What is MySqli
- mysql query
- mysql query example
- InnoDB
- mysql column Type
- CRUD Example
- Connection Using Function
- mysql keys
- SELECT
- WHERE
- UPDATE
- Count no of Rows
- ALIAS
- AND, AND & OR
- BETWEEN
- COMPARISON OPERATOR
- DELETE
- DELETE LIMIT
- DISTINCT
- EXISTS
- FROM
- GROUP BY
- HAVING
- IN
- INTERSECT
- IS NULL & IS NOT NULL
- LIKE
- NOT
- ORDER BY
- SELECT LIMIT
- SUBQUERY
- TRUNCATE
- UNION && UNION ALL
- Concat & Group_Concat
- mysql Function
- Mysql Insert Id
- MySql Aggregate Function
- Mysql Join
- JOIN in MySql
- Trigger
- Procedure
- Transaction
- views
- Index
- SQL Injection
- Normalization
- Query Bind
- Interview Questions
Important Link
update
UPDATE statement is used to update existing records in a table
Update single column
UPDATE customers
SET last_name = 'habib'
WHERE customer_id = 231;
Update multiple columns
UPDATE customers
SET state = 'bihar',
customer_age = 32
WHERE customer_id > 100;
How to update multiple record in one column.
UPDATE itechxpert SET status = 7 WHERE emp_id IN (10,12,15);
Update table with data from another table
UPDATE customers
SET city = (SELECT city
FROM suppliers
WHERE suppliers.supplier_name = customers.customer_name)
WHERE customer_id > 2000;
Update multiple Tables
UPDATE customers, suppliers
SET customers.city = suppliers.city
WHERE customers.customer_id = suppliers.supplier_id;
Replace and Update
UPDATE `ittutorial`
SET crated_date = REPLACE(created_date, '1986-01-01', '2020-05-07')
WHERE crated_date LIKE '%1986-01-01%'
UPDATE customers
SET customers.city = 'Ara'
WHERE customer_id >=10 AND customer_id <=20;