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

  • SEARCH
  • Home
  • 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 9118509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:10:17+00:00 2026-06-17T05:10:17+00:00

SELECT rates_Calendar.date, subQuery.name, COALESCE(subQuery.amount,0) as amount, subQuery.reference, subQuery.property FROM rates_Calendar LEFT JOIN ( SELECT

  • 0
SELECT

    rates_Calendar.date,
    subQuery.name,
    COALESCE(subQuery.amount,0) as amount,
    subQuery.reference,
    subQuery.property


FROM
    rates_Calendar
    LEFT JOIN (
                SELECT
                    rates_Booking.date,
                    unit.unit,
                    unit.abbreviation as name,
                    rates_Booking.amount,
                    rates_Booking.bookingReference AS reference,
                    property.property


                FROM
                    rates_Booking

                    LEFT JOIN booking ON booking.reference = rates_Booking.bookingReference

                    LEFT JOIN unit ON booking.apartment = unit.unit

                    LEFT JOIN property ON property.property = unit.property

                    # unit to apartments
                    LEFT JOIN apartments ON (apartments.unit = unit.unit)
                    LEFT JOIN apartmentTypes ON (apartmentTypes.id = apartments.apartmentTypeId)

                WHERE
                    rates_Booking.date BETWEEN @startDate AND @endDate
                    AND unit.unit = 221



                GROUP BY
                    property.area,
                    property.property,
                    apartmentTypes.id,
                    unit.unit,
                    rates_Booking.date

                ) AS subQuery ON subQuery.date = rates_Calendar.date


 WHERE
     rates_Calendar.date BETWEEN @startDate AND @endDate
 GROUP BY 
subQuery.reference,
subQuery.unit,
subQuery.apartmentTypeId,
subQuery.property,
subQuery.area,
    rates_Calendar.date

Now, obviously this query will result in NULLS for dates that do not match.
Is there a way to update all the NULLS with the NON NULL values?

2013-01-01  unitA 138 1      property1
2013-01-02  unitA 138 1      property1
2013-01-03  unitA 138 1      property1
2013-01-04  NULL  0   NULL   NULL
2013-01-05  NULL  0   NULL   NULL

Is there a way to update the NULLs with the NON NULLS in the respective columns ?

I’m trying for this because hiding rowGroups with NULLS is not possible as can be understood from the link:
Hide NULL Row Groups JasperReports

  • 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. Editorial Team
    Editorial Team
    2026-06-17T05:10:18+00:00Added an answer on June 17, 2026 at 5:10 am

    I think you don’t want a LEFT JOIN then with your subQuery. Try this:

    SELECT
    
        rates_Calendar.date,
        subQuery.name,
        COALESCE(subQuery.amount,0) as amount,
        subQuery.reference,
        subQuery.property
    
    
    FROM
        rates_Calendar, (
                    SELECT
                        rates_Booking.date,
                        unit.unit,
                        unit.abbreviation as name,
                        rates_Booking.amount,
                        rates_Booking.bookingReference AS reference,
                        property.property
    
    
                    FROM
                        rates_Booking
    
                        LEFT JOIN booking ON booking.reference = rates_Booking.bookingReference
    
                        LEFT JOIN unit ON booking.apartment = unit.unit
    
                        LEFT JOIN property ON property.property = unit.property
    
                        # unit to apartments
                        LEFT JOIN apartments ON (apartments.unit = unit.unit)
                        LEFT JOIN apartmentTypes ON (apartmentTypes.id = apartments.apartmentTypeId)
    
                    WHERE
                        rates_Booking.date BETWEEN @startDate AND @endDate
                        AND unit.unit = 221
    
    
    
                    GROUP BY
                        property.area,
                        property.property,
                        apartmentTypes.id,
                        unit.unit,
                        rates_Booking.date
    
                    ) AS subQuery
    
    
     WHERE
       rates_Calendar.date BETWEEN @startDate AND @endDate
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SELECT Id,Date,Name FROM people WHERE DATEPART(hh,Date) >= 7 AND DATEPART(hh,Date) <= 8 Order by
SELECT * From `users` AS `User` LEFT JOIN `selections` AS `Selections` ON (`Selections`.`user_id` =
The following query works: SELECT SUM(sales), date FROM sales INNER JOIN exchange_rates USING(date) But
select tf.Id,tf.Name,tf.LName,tf.Rank,tf.Category where tf.Id not in (select fighter_id from tbl_player_fighter where league_id=91) and tf.Status
I have been told the following is insecure: cursor.execute(SELECT currency FROM exchange_rates WHERE date='%s'%(self.date))
My current query reads: SELECT entry_id, user_id, cat_id, AVG( rating ) as avg_rate FROM
SELECT REPLACE([strUrl], '/myoldurl', '/mynewurl') FROM [UrlRewrite] If strUrl is /myoldurl/myoldurl_something_else , it returns /mynewurl/mynewurl_something_else
am trying to use javascript for custom styled select boxes from www.gerrendesign.com/entry_images/selectboxdemo.zip and as
I am trying to select 1 of 2 rate columns from a table based
I have the following query: SELECT rt.ID, rt.Name, rt.Rate, rt.Colour, vtb.ID AS 'vtbID', vtb.Value,

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.