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 7602999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:33:23+00:00 2026-05-30T23:33:23+00:00

I got the result while executing my query as: state city user_count restaurant_count order_count

  • 0

I got the result while executing my query as:

state city  user_count   restaurant_count   order_count
a      b      0            0                 5
a      c      2            0                 0 
a      d      0            0                 0

and my query is :

SELECT `eat_state_locale`.`state`, `eat_city_locale`.`city`, `eat_city_locale`.`location`, `eat_city`.`city_id`, count(distinct eat_user.user_id) as user_count, count(distinct eat_delivery.restaurant_id) as restaurant_count, count(distinct eat_order.order_id) as order_count FROM (`eat_state`) JOIN `eat_state_locale` ON `eat_state_locale`.`state_id`=`eat_state`.`state_id` JOIN `eat_city` ON `eat_state`.`state_id`=`eat_city`.`state_id` JOIN `eat_city_locale` ON `eat_city_locale`.`city_id`=`eat_city`.`city_id` LEFT JOIN `eat_user` ON `eat_user`.`city_id`=`eat_city`.`city_id` LEFT JOIN `eat_delivery` ON `eat_delivery`.`delivery_city_id`=`eat_city`.`city_id` LEFT JOIN `eat_order` ON `eat_order`.`delivery_city_id`=`eat_city`.`city_id` LEFT JOIN `eat_printer` ON `eat_printer`.`order_id`=`eat_order`.`order_id` WHERE `eat_state_locale`.`language_id` = 1 AND `eat_city_locale`.`language_id` = 1 GROUP BY `eat_city`.`city_id` ORDER BY `eat_state`.`state_id` asc 

here i need to get the result like (after avoiding the null values as:)

state city  user_count   restaurant_count   order_count
a      b      0            0                 5
a      c      2            0                 0 

how will I get such result?Here no issue in the counted result..I need to avoid the null result

  • 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-05-30T23:33:24+00:00Added an answer on May 30, 2026 at 11:33 pm

    Edit:

    SELECT 
       blah
    HAVING
       user_count > 0 AND
       restaurant_count > 0 
       AND order_count > 0;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a query that returns a proper result set, using SQL 2005. It
i've got the following linq2sql query, and i'm setting the result to a POCO.
why is the code below showing 'got the result null' alertbox ? while the
I'm implementing the in-app purchase. And I got the problem while executing the delegate
print_r($array) results I retrieved some values from database and got the following result while
When I perform SELECT * FROM table I got results like below: 1 item1
I've got a reasonably simple query (this time) that I need ALL the results
I got an exception with message No printers are installed. while printing a report
Got a working AJAX form: @using (Ajax.BeginForm(...)) I want to disable the button while
While implement the code below, I got itemCount = 3 , but it should

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.