Skip to content

Tag: sql-update

How to copy data from one column to another?

I am trying to add Property Address in columns that have a missing value. I use the below to identify common parcel IDs with corresponding property address since the same parcelIDs have the same PropertyAddress as well. I get this result: Now I want to add the data in column IFNULL(n.PropertyAddress,n2.PropertyAddress) to the missing PropertyAddress cells using the below: However,

Inserting multiple rows of data into a single column

Absolute SQL beginner here: I have a table ‘students’ with the columns ‘id'(primary key), ‘name’ and ‘mark’. I am now trying to add the marks for a number of students. Just using multiple UPDATE statements like seems rather dull and labor intensive. What would be the most simple and elegant way to execute such an operation using MS SQL? Answer

Updating webclient response from database

I have situation where I can’t update column at database. The problem is that only method setIsPurchased is executed and the flag is_purchase at SQL table changed to true, but the next line with setPurchasedDate which has to set current time is not executed. The response from database is Mono<Void> type. Queries for those two method are simple and looks

MYSQL Update same column with multiple where clause

I found this question, seems like same as mine. However, there’s a little difference between the two as that one is using the same column in where clause and I have a different one. This is what I’m trying to achieve; is it possible to do that in one query? EDIT: The data type of recent is Boolean, and there

Conditional update with jsonb_set()

I have a table in a Postgres 11.3 database with a jsonb column. Trying to update all objects inside a nested array name “iProps”. If the path {iProps -> value -> rules -> ao -> sc} is an object, then the path should be updated from an object to a string with the value {iProps -> value -> rules ->