Skip to content
Advertisement

TSQL – join two tables with TotalCounter and Pagination

I’m trying to join 2 tables (one to many relation) that include all the columns from first table and only the number of rows from the second one.

Use case: one Service has many Reviews.

The query looks like:

The error is I need to include either average or group by clause but how would that look like I can’t figure out? Any help is much appreciated

Advertisement

Answer

  • You are using this code
  • I am using SQL PARTITION BY to divide the result set into partitions and perform computation on each subset of partitioned data.
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement