Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sapator
Constraint Violating Yak Guru
462 Posts |
Posted - 2014-10-15 : 04:38:29
|
Hi: select count(*), tbf.film_strtitle from tblTrans_Ticket tr inner join tblsession S on s.Session_lngSessionId = tr.Session_lngSessionId inner join tblFilm tbf ON tbf.Film_strCode = s.Film_strCode I want to sum the seats. What i have here is the strtitle of every cinema. The issue here is that a film will play in multiple screens, so i could get results like:10 film1 screen113 film1 screen233 film2 screen1etc. |
|
sz1
Aged Yak Warrior
555 Posts |
Posted - 2014-10-15 : 05:05:48
|
Do you mean you just want the total seats no matter what cinema? one figure result:10 film1 screen113 film1 screen233 film2 screen1Total Seats = 56?We are the creators of our own reality! |
|
|
sapator
Constraint Violating Yak Guru
462 Posts |
Posted - 2014-10-16 : 03:08:32
|
Hi.Exactly. |
|
|
djj55
Constraint Violating Yak Guru
352 Posts |
Posted - 2014-10-16 : 13:40:13
|
So select count(*) from tblTrans_Ticket tr inner join tblsession S on s.Session_lngSessionId = tr.Session_lngSessionIdinner join tblFilm tbf ON tbf.Film_strCode = s.Film_strCode; does not give you the number you wish?djj |
|
|
sapator
Constraint Violating Yak Guru
462 Posts |
Posted - 2014-10-19 : 12:37:53
|
I also need the column with the individual films.So 10 film1 screen1 --- Total Seats = 5613 film1 screen2 --- Total Seats = 5633 film2 screen1 --- Total Seats = 56I don't mind the multiple sum. |
|
|
|
|
|