Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
When a list has been grouped by, the number of records in the list does not match the number of records in the SQL statement - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • When a list has been grouped by, the number of records in the list does not match the number of records in the SQL statement
KB0598487

When a list has been grouped by, the number of records in the list does not match the number of records in the SQL statement


452 Views Last updated : Oct 17, 2023 public Copy Permalink
KB Summary by Now Assist

Description

When a list has been grouped by, the number of records in the list does not match the number of records in the SQL statement.

Steps to Reproduce

 

  1. Log in to the instance.

  2. Enable Debug SQL (detailed).

  3. Type cmdb_ci.list in the search box.

  4. Group the list retrieved on Manufacturer.

  5. Make a note of the number of items.

  6. Search for "Group By" in the logs and locate the following statement:

    SELECT ... FROM (cmdb_ci cmdb_ci0 LEFT JOIN core_company core_company1 ON cmdb_ci0.`manufacturer` = core_company1.`sys_id` ) GROUP BY cmdb_ci0.`manufacturer`,core_company1.`name` ORDER BY core_company1.`name` 7)

  7. Execute the following statement in Scripts-Background (note the change in number at the end):

    SELECT count(*) FROM (cmdb_ci cmdb_ci0 LEFT JOIN core_company core_company1 ON cmdb_ci0.`manufacturer` = core_company1.`sys_id` ) GROUP BY cmdb_ci0.`manufacturer`,core_company1.`name` ORDER BY core_company1.`name` 8).

  8. Paste the result retrieved into an Excel spreadsheet.

    Observe the number of records in the spreadsheet.

Workaround

No workaround is available at this time. 


Related Problem: PRB623525

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.