WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

Displaying PostgreSQL NULL Values in a Join

PlumPlant

New member

0

0%

Status

Offline

Posts

31

Likes

0

Rep

0

Bits

165

3

Months of Service

0%
Hello friends. I need to write a query where I retrieve years from a different view. Within the main query, I want to match the values with the years in the view and display them. My goal is to also include unmatched years and show the "value" column as NULL. Here is my query: select s.station_no::int station_no, s.station_name, y.year year, s.month::decimal month, s.value::decimal value FROM monthly_average_temperature s FULL JOIN yearly_temperature as y ON s.year::int=y.year WHERE s.station_no='18401' and month='13' ORDER by month
 

249

6,622

6,642

Top