2

I have a table with fields menuid,name,price,quantity & spiciness.

I want to update Quantity if the new menuid and spiciness are same.Otherwise I need to add a new row if the new spiciness is different.

Is there any simple way to achieve this?

1

1 Answer 1

1

can use insert or replace. there must need a primary key in your table. if the key exist it will automatically update otherwise insert a new row

INSERT OR REPLACE INTO table_name VALUES() 

hopes it will help

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.