Joins are the one thing I could never get my head around, ie, which type to use and how they actually work. I need to write a query and I know I will need a join for it.
The database is postgres.
Basic table set up is like this (some details redacted)
rates (
rates_id Primary Key, Auto Increment
state String, can either be 'current' or 'history'
)
rates_records (
rates_records_id Primary key, auto increment
rates_id = integer
column_1,
column_2
)
Every rates_records
entry has rates_id
set to a value that exists in the rates
table
I want to update every rates_records
row and modify the column_1
and column_2
data where the associated rates
state = 'current'
How would I do this? Thanks