Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/14/2021 in Posts

  1. If you have a GROUP BY to calculate an aggregate (SUM, COUNT etc) you can't use WHERE on the aggregate value as it's value isn't known until the end of the query. So while a WHERE clause filters inputs, a HAVING clause filters outputs. The COUNT(*) .. GROUP BY is givings me a count the records for each combination of job_number/line_item. As we are looking for duplicates we are only interested in those with a count of more than one. As for JOIN vs UNION... SELECT ... FROM A JOIN B gives you rows with columns from both A and B. So a join extends the columns. SELECT ... FROM A UNION SELECT ... FROM B gives you the rows from the first select followed by those from the second. So a union extends the rows.
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.