User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 423,874 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,998 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums

Troubled with Rewriting Subquery as JOINs

Join Date: Jan 2005
Posts: 18
Reputation: demo is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 2
demo demo is offline Offline
Newbie Poster

Re: Troubled with Rewriting Subquery as JOINs

  #2  
Apr 26th, 2005
Hi

I would add a 'group by' and add the date to the return so you know what date the return is telling you about. But without knowing the column types I am a bit lost as to how I would do the grouping / ordering! What I mean is that you can pull stuff from table booking and add it to each row returned from table room!

	SELECT
	*
	FROM room AS r
	LEFT JOIN booking AS b
	ON ( r.room_no = b.room_no AND r.room_type = 'single' )
	WHERE
	b.arrivel_date = '2005-04-23'
	AND
	b.departure_date = '2005-04-30'

demo
Reply With Quote  
All times are GMT -4. The time now is 4:28 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC