Wrox Programmer Forums
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 19th, 2011, 03:32 AM
Authorized User
 
Join Date: Jan 2005
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hossrad
Default Join Issue

Hi everyone,
I've been challenging with an query for a while now. I was wondering if anyone would help me with the subject.
Assume that I have a table named "Reservations"
this table has two dates as fields: "FromDate" and "ToDate"
A sample record would be like this:
"John Doe" "2010/09/02" "2010/09/04"
this means that John Doe has reserved a room from Sept 2th until Sept 4th.
Now I want a list of dates in a given range with the count of reservations regarding that date.
In this instance, if you assume that John Doe is the only reservation, the result set would be like this:
.
.
.
2010/09/01 0
2010/09/02 1
2010/09/03 1
2010/09/04 1
2010/09/05 0
.
.
.
__________________
Be Sure,
-hossrad





Similar Threads
Thread Thread Starter Forum Replies Last Post
Logical issue in 'Outer join', why out join is not working, the way it should? arbab Oracle 5 March 7th, 2011 09:22 AM
I'm new to join oneilsteven BOOK: ASP.NET Website Programming Problem-Design-Solution 0 February 9th, 2008 06:07 PM
More than one join jaywhy13 Classic ASP Basics 2 January 31st, 2005 11:38 PM
INNER JOIN msmagied Classic ASP Databases 3 August 29th, 2004 12:28 PM
Oracle 8i inner join and left join problem puteri_84 Oracle 2 August 19th, 2004 07:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.