Skip to content

Join and flatten table output

I am currently trying to join 3 tables. The main table is company, if there is 3 companies and 2 roles exists in the role table I want the output to be like this: Company1, Role 1, …

Retrieve all records with the 5 most recent distinct dates

I need to retrieve data for a history module with pagination. The requirement is to show the records for the five most recent dates first (regardless of the number of rows) and load the remaining records in lots (next five dates, any number of rows) as requested by the user. I came up with the query below, wh…

SQL query for most recent date

I’m trying to query to only pull the most recent sale date but keep the unique value of “strap”. This is the query result I have. nh_cd strap dor_cd acreage sqft sale date …