Counting Problem – SQL Server 2000

0 pts.
Tags:
SQL
SQL Server
Counting Records - SQL Server 2000 I need to count rooms sold. The problem is that a room can be sold more than once for any given trip. How can I retrieve all records including one instance where the room has been sold multiple times on a given trip? Example: Inv. Trip Room 1 A50805 201 2 A50805 202 3 B60805 201 4 B60805 201 The query should return records 1, 2, 3. Any help greatly appreciated!
ASKED: May 8, 2005  6:12 AM
UPDATED: May 9, 2005  4:04 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

select distinct trip, room

will return one record for each unique combination of trip and room that exists in the table.
Curiosity question: How came a room be sold more than once for a single trip?

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following