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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:12:45+00:00 2026-06-14T22:12:45+00:00

With this query, I get a result that is two short of the table

  • 0

With this query, I get a result that is two short of the table because they are not included in count, and I would like get the NULL values in the result. To do this, I am pretty sure I need to use a subquery of some kind, but I am not sure how, since the attribute in question is an aggregate.

SELECT Equipment.SerialNo , Name, COUNT(Assignment.SerialNo) 
FROM Equipment
INNER JOIN Assignment
     ON Assignment.SerialNo = Equipment.SerialNo

GROUP BY Equipment.SerialNo, Name
  • 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-14T22:12:46+00:00Added an answer on June 14, 2026 at 10:12 pm

    You need to change your inner join to a left outer join and count something other than Assignment.SerialNo if you want all rows counted — use count(*) or another property that will not be null, as count(column) does not include nulls for that column. If you don’t want null Assignment.SerialNo values included in the count, then continue aggregating on that column.

    An inner join by definition will skip values where Assignment.SerialNo is NULL— an outer join will include them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The first thing i would like to say is that this is not exactly
I would like to run a query on two table products and category, There
Why I get error with this query on my live server but not on
I want to get the information that is returned by this query from SolrNet:
Imagine an account table that looks like this: Column | Type | Modifiers ------------+-----------------------------+-----------
I'm able to get the following results with this working query: $query = SELECT
Hello I've got this query to get users by email, which is an unique
I have this query and I get error Operand should contain 1 column(s), whats
I've used this MySQL query to get data: SELECT DISTINCT A.*, B.username FROM posts
I want to use this SQL query to get only the records between 8

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.