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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:57:56+00:00 2026-06-17T01:57:56+00:00

I have a table called items id month year **itemname** distmoney 1 12 2012

  • 0

I have a table called “items”

id       month       year       **itemname**       distmoney
 1        12         2012         chicken           20
 2        12         2012         pork              15
 3        11         2012         chicken           21
 4        11         2012         pork              15

I am trying to run a “difference report” on items with the same name.

So for chicken, it is found in month 12 & 11. If distmoney is different for these two months, i want to echo a warning or something of that nature. In my example above, distmoney for chicken is 20 for month 12 but 21 for month 11. So, a “warning!” should be echoed. For pork, however, distmoney remains the same so I would just echo “no issues” or something of the sort.

How can I go about doing this?

Thanks for any help. It is much appreciated.

  • 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-17T01:57:57+00:00Added an answer on June 17, 2026 at 1:57 am

    You can GROUP BY the rows on the itemname column and see how many distinct values are in distmoney column. If there are more than one distinct value, then there may be a problem.

    SELECT 
        name,
        IF(COUNT(DISTINCT distmoney) > 1, 'warning!', 'no issues') AS status
    FROM
        items
    GROUP BY
        name
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table called items id month year **itemname** distmoney 1 12 2012
In the table ogitems, I have a column called itemname, month, and price. There
let's say that I have a table called Items (ID int, Done int, Total
I working on a website and have a mysql-table called 'items', like: item_id |
I have a table called transactions with a many-to-many relationship to items through the
I have two table TempStore and Store with the same column called Items. There
I have a table called items. IN this table there are many columns. One
I have a table in my SQL Server database called items which has a
So I have an example table called items with the following columns: item_id (int)
I have a table called items. I want to change the description attribute (it's

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.