Daniel O.
Daniel O.

Reputation: 813

SQL INSERT based on criteria

I have a Song database that I have created using the Spotify Web API. At the moment my database has a table with the following columns; spotify_uri, key, tempo. The key column stores the songs key as an integer value E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on.

If I create a new column called a_key, what would be the statement to insert the value "C" in to the a_key column where key=0 ?

Upvotes: 0

Views: 43

Answers (1)

LordBaconPants
LordBaconPants

Reputation: 1414

Update table 
set a_key = 'C' 
where key = 0

Upvotes: 2

Related Questions