-1

I would like to update value in productcatergory from bike to bikes in id 1 (row)

mysql> select * from productsale; +----+------------------+--------+------------------+--------------+-------------+-------------+-----------+------------+ | id | productcatergory | color | productname | standardcost | dealerprice | salesamount | taxamount | orderdate | +----+------------------+--------+------------------+--------------+-------------+-------------+--------- | 1 | bike | yellow | road-550-w,38 | 413 | 419 | 699 | 56 | 2015-05-25 | | 2 | bikes | black | Road-650,58 | 413 | 419 | 699 | 56 | 2015-05-10 | | 3 | components | black | HL Road Frame,44 | 413 | 419 | 699 | 56 | 2015-04-29 | +----+------------------+--------+------------------+--------------+-------------+-------------+--------- 

kindly help me how to do?

4
  • 5
    Come on, you can do this yourself, at least try something. That's worth a read for you. Commented Mar 7, 2020 at 2:22
  • If you are encountering an issue with performing this update that hasn't been covered by another question -which I doubt, it's definitely worth some searching- then please include the issue's details and what you've tried. Commented Mar 7, 2020 at 4:33
  • This is very specific, just a simple UPDATE with WHERE id=1. But your question might actually be something more than just I want to update bike to bikes in id 1.. Maybe something like How do I find all Id that have almost similar value like bike and bikes and update them to bikes or all id with almost similar value like component and components and update them all to components without having to search and update one by one? .. .then that's a different question altogether.. Commented Mar 7, 2020 at 6:09
  • Does this answer your question? Update a column in MySQL Commented Mar 7, 2020 at 8:32

1 Answer 1

0

You should try to read the link provided by sticky bit. Following is one way to update column in specific row:

UPDATE productsale SET productcatergory = 'bikes' WHERE id = 1 
Sign up to request clarification or add additional context in comments.

2 Comments

thanks for the help it worked. i have tried in different formats but i didn't work.I have doubt . suppose if want to change name on productcatergory to productcategory. how can i do
For changing column name, you may use Alter Table command. Pls read docs of sql on this. And try to read tutorials first.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.