As i have created a table with four attribuites or class have total five case values in each attribuites or class. Now i have added one more attribuites or class, but i dont able to unsderstand how i add values in this attribuites or class for five cases. exm for email at one go.
Gud mrng sam , i think i need to clear my question in details as
i have already a table with four attributies such as below having data
|name |address|phone|
|skhan |abc |1123|
|rkhan |def |123|
|bkhan|ghi |2345|
now i have added new attribute email. now my new table looks like as
That depends on where you get the email from. If you just want to do mass updates the usual way would be to do individual updates (I assume that there is an id column as in your first post)
UPDATE yourtable SET email = 'skhan@domain.com' WHERE id = 1;
UPDATE yourtable SET email = 'rkhan@another.com' WHERE id = 2;
This will work on any DBMS.
In recents versions of MySQL you can use the same SQL you would use to insert the initial values and add an ON DUPLICATE KEY UPDATE clause:
INSERT INTO yourtablename (id, name, address, phone, email) AS new
VALUES (1, 'skhan',' abc', '1123', 'skhan@domain.com'),
(2, 'Rkhan', 'def', '123', 'rkhan@another.com')
ON DUPLICATE KEY UPDATE email = new.email;
```So that inserts the specified rows if they don’t exist. If it already exists, it updates the email column with the value from the row we tried to insert.
thanks sam i will try i hope the same is work in Microsoft sql too. Sam actually just give brief intro of myself i m from india and having electrical engg background not from software or computer engg. bcoz of my interest to make some application for my filed i learned SQL, HTML/CSS and Python.
Right now i m making a web based application for Switchgear Sizing project for my company siemens.
If ur comfortable can u please guide me for the same then i will share other details and my approach which i m taking right now.