• zepplenzap@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    1 year ago

    It has been years since I wrote any SQL, so I may just be missing something but:

    Why is the “As it could be” example for the second example using sub selects?!

    Especially the one in the where clause where they are selecting two tables that they already joined in the from clause?

    And wouldn’t it be quicker to join the review table and use a group by?

    • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      0
      arrow-down
      1
      ·
      1 year ago

      I think the example is trying to optimize for readability to show that it can be pretty intuitive, but I think you’re right.