Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 79365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:08:04+00:00 2026-05-10T21:08:04+00:00

I have 2 tables event + event_artist event eventId | eventName ——————- 1 ,

  • 0

I have 2 tables event + event_artist

event

eventId | eventName   ------------------- 1 , gig1   2, gig2     

event_artist

eventId, artistName  -------------------  1, Led Zip   1, The Beatles   

ie Led Zep and the Beatles are both playing @ Gig1

I need to create the SQl to bind to a gridview ( you necessarily need to know about gridviews to answers this )

The results that i want would look like this
eventId = 1, EventName = Gig1. ArtistLineup = Led Zep, The beatles

So i need to create an alias ArtistLineup that would list all the artist. Via an inner select i think.

Any thoughts on what this would look like.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:08:04+00:00Added an answer on May 10, 2026 at 9:08 pm

    Saw this in SQL Server Magazine- not great, and the total list will have an upper length limit, but:

    drop table event go  drop table event_artist go  create table event (eventid int, eventname varchar(255)) go  create table event_artist (eventid int, artistname varchar(255)) go  insert into event values (1, 'gig1') go  insert into event values (2, 'gig2') go  insert into event_artist values (1, 'Led Zip') go  insert into event_artist values (1, 'The Beatles') go  drop function Event_Display go  create function Event_Display (@EventID int) returns varchar(2000) as begin     declare @artistList varchar(2000)     set @artistList=''      select @artistList=@artistList + ', ' + isnull(artistname,'')      from event_artist      where eventid=@EventID      return substring(@artistList,3,2000)  --eliminate initial comma end go  select event.eventid, event.eventname, dbo.Event_Display(event.eventid) from event  
                                                                                                                                                                                                                                                        1           gig1        Led Zip, The Beatles  2           gig2      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 3 tables event, location, event_location. Event can have multiple locations. Location table
I'm designing a staff rota planner....have three tables Staff (Staff details), Event (Event details),
I have got two tables: Event +----------+---------+--------------+ | event_id | name | date |
Let's say you have three tables named Item, Event, and Seat, constructed as such:
I have a few tables: event_type ( et ), event ( e ), event_booking
I have events , events_styles , events_formats tables (an event can have many styles
I have two tables, let's call them meetings and phone calls. They both implement
i have two tables, program and event. what i am trying to do is
i have got 3 tables: Event, task, task_handler. EVENT: event_id|name TASK_HANDLER: event_id|task_seq|handler TASK: event_id|task_seq|script
I have two tables : tracklist(trackid artist event date) and radded(trackid, user) with relation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.