i have a stored procedure that is complaining about a group by clause but i can see nothing wrong with it

Anonymous
2024-01-19T19:38:22.0266667+00:00

Would someone PLEASE tell me what is wrong with this?

select d.customer_no, e.sort_name, d.order_no, d.perf_no, d.season_desc, h.prod_no, b.seat_no, g.description 'section', f.seat_row, f.seat_num, a.sli_no, a.last_event, b.event_code, c.description 'event_code_desc'
into #raw
from #last_activity a
	join T_ORDER_SEAT_HIST b on a.last_event = b.id
	join TR_EVENT_CODE c on b.event_code = c.id
	join LV_ALL_TICKET_SALES_V12 d on a.sli_no = d.sli_no
	join t_customer e on d.customer_no = e.customer_no
	join t_seat f on d.seat_no = f.seat_no
	join tr_section g on f.section = g.id
	join t_production h on h.prod_no=t_ticket_history.prod_no
	join t_ticket_history  
group by d.customer_no, e.sort_name, d.order_no, d.perf_no, d.season_desc
, h.prod_no, b.seat_no, g.description, f.seat_row, f.seat_num, a.sli_no, a.last_event, b.event_code, c.description
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,353 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,600 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Viorel 114.7K Reputation points
    2024-01-19T20:01:06.78+00:00

    Try to add the 'on' condition after join t_ticket_history.

    1 person found this answer helpful.

  2. Ken Kam Hung, Lin 91 Reputation points
    2024-01-22T01:57:54.3833333+00:00

    "join t_ticket_history" is missing which columns to map between the result and t_ticket_history table.

    0 comments No comments