Delete record and update default column to zero if one
I want virtual delete one item in database , when (id = 2 And productId = 1 and deleted=0) . this query change row id 2 and set deleted column to one, it means row deleted and if this row is default then change to default=0
(that mean this row not default row) and random select another row d product=1
set default column to one. this query work correctly. but when i have only one row of productId = 1
this query not work because needs min two rows of productId = 1
and deleted=0.
Delete record and update default column to zero if one
I want virtual delete one item in database , when (id = 2 And productId = 1 and deleted=0) . this query change row id 2 and set deleted column to one, it means row deleted and if this row is default then change to default=0
(that mean this row not default row) and random select another row d product=1
set default column to one. this query work correctly. but when i have only one row of productId = 1
this query not work because needs min two rows of productId = 1
and deleted=0.
Delete record and update default column to zero if one
I want virtual delete one item in database , when (id = 2 And productId = 1 and deleted=0) . this query change row id 2 and set deleted column to one, it means row deleted and if this row is default then change to default=0
(that mean this row not default row) and random select another row d product=1
set default column to one. this query work correctly. but when i have only one row of productId = 1
this query not work because needs min two rows of productId = 1
and deleted=0.
Delete record and update default column to zero if one
I want virtual delete one item in database , when (id = 2 And productId = 1 and deleted=0) . this query change row id 2 and set deleted column to one, it means row deleted and if this row is default then change to default=0
(that mean this row not default row) and random select another row d product=1
set default column to one. this query work correctly. but when i have only one row of productId = 1
this query not work because needs min two rows of productId = 1
and deleted=0.
Delete record and update default column to zero if one
I want virtual delete one item in database , when (id = 2 And productId = 1 and deleted=0) . this query change row id 2 and set deleted column to one, it means row deleted and if this row is default then change to default=0
(that mean this row not default row) and random select another row d product=1
set default column to one. this query work correctly. but when i have only one row of productId = 1
this query not work because needs min two rows of productId = 1
and deleted=0.
Delete record and update default column to zero if one
I want virtual delete one item in database , when (id = 2 And productId = 1 and deleted=0) . this query change row id 2 and set deleted column to one, it means row deleted and if this row is default then change to default=0
(that mean this row not default row) and random select another row d product=1
set default column to one. this query work correctly. but when i have only one row of productId = 1
this query not work because needs min two rows of productId = 1
and deleted=0.
Delete record and update default column to zero if one
I want virtual delete one item in database , when (id = 2 And productId = 1 and deleted=0) . this query change row id 2 and set deleted column to one, it means row deleted and if this row is default then change to default=0
(that mean this row not default row) and random select another row d product=1
set default column to one. this query work correctly. but when i have only one row of productId = 1
this query not work because needs min two rows of productId = 1
and deleted=0.
How to sum the results of two different queries on different columns?
Here my customers
table:
How to sum the results of two different queries on different columns?
Here my customers
table:
How do I populate values in same column which are null with non null values of same column on the basis of id
Example: Input Records