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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL queries using count functions

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-04-30 : 13:58:15
Vanisha writes "Hi,

This is the question i am trying to work out,

how would you retreive performers who would have bookings at more than one venue.

Below are the following entities followed by the attributes

EVENT
Event_id
Event_name
Event_type

AGENT
Agent_id
Agent_name
Agent_location

FEE
Performer_code
Performer_type
Fee

VENUE
Venue_id
Venue_name
Venue_location

PERFORMER
Performer_id
Perforner_name
Performer_code
Performer_location
Performer_age

BOOKING
Booking_Id
Performer_id
Agent_id
Venue_id
Event_id
Booking_date"

nr
SQLTeam MVY

12543 Posts

Posted - 2004-04-30 : 14:25:58
select performer_id
from Booking
group by performer_id
having count(distinct Venue_id) > 1


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -