0

I have three tables with relationship.

TableDetail

ID(PK), TableNo

BookingDet

ID(PK), BookID(FK BookingMstr.BookID), TblID(FK TableDetail.ID)

BookingMstr

BookID(PK), Date

I want to get table list comma separated for each Booking

TableDetail
1  1
2  2

BookingDetail
1 1 1
2 1 2
3 2 1

Result Table
1 1,2

I have tried This query but gives me values like

    (ID) (TableNo)
      1    1,2,1 
      2    1,2,1

But I want it like

    1  1,2,1

Thanks.

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
DhavalR
  • 1,409
  • 3
  • 30
  • 53
  • 1
    What are your expected results from the fiddle you posted? – sgeddes May 16 '16 at 20:03
  • Basically I want to show all bookings that shows `ClientName, NoOfPersons, Date, TABLE_LIST (this must be comma separated because client can book more than one table)`, and others. – DhavalR May 17 '16 at 01:28
  • I think this is a duplicate of http://stackoverflow.com/questions/5452681/sql-aggregating-strings-together – Brett May 17 '16 at 12:32

0 Answers0