如何在特定的行中分别插入列值?

时间:2022-03-09 07:38:51

I have a table with columns {a, b, c} and for row x I want to add a value for a, then a value for b, then a value for c all in separate activities as the user progresses through my app (for another user, values for a, b, and c would be added separately to a row y). How can I do this?

我有一个表列{ a,b,c }行x,我想添加一个值,然后b的值,然后对c值都在单独的活动随着用户的发展通过app(另一个用户,值a、b和c将分别添加一行y)。我怎么能这样做呢?

2 个解决方案

#1


1  

a can be insert and then b and c will have to be updates to the row

a可以插入,然后b和c必须对行进行更新

#2


1  

i think you need to add a primary key to your table {a,b,c,key_column}

我认为您需要在表{a、b、c、key_column}中添加主键

and then you can use below..

然后你可以在下面使用。

To update a:-

更新:-

UPDATE table_name
SET a=valueA
WHERE key_colum=key_value;

To update b:-

更新b:-

UPDATE table_name
SET b=valueB
WHERE key_colum=key_value;

To update c:-

更新c:-

UPDATE table_name
SET c=valueC
WHERE key_colum=key_value;

#1


1  

a can be insert and then b and c will have to be updates to the row

a可以插入,然后b和c必须对行进行更新

#2


1  

i think you need to add a primary key to your table {a,b,c,key_column}

我认为您需要在表{a、b、c、key_column}中添加主键

and then you can use below..

然后你可以在下面使用。

To update a:-

更新:-

UPDATE table_name
SET a=valueA
WHERE key_colum=key_value;

To update b:-

更新b:-

UPDATE table_name
SET b=valueB
WHERE key_colum=key_value;

To update c:-

更新c:-

UPDATE table_name
SET c=valueC
WHERE key_colum=key_value;