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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:07:13+00:00 2026-05-26T05:07:13+00:00

There is a table i work in Mysql. There are words and values. Values

  • 0

There is a table i work in Mysql. There are words and values. Values is Boolean like ‘1’ or ‘0’. Words can repeat more than once. And their values vary. For example one “def” can be ‘0’ while other is ‘1’. What i am trying to find is:

  • The values only have zero values. And if there is more than once of this word take only one word.
  • But, “def” has ‘0’ value. Also ‘1’ value. It must be only ‘0’ values!

The table is like:

word value
----  -----
abc    1
abc    1
def    0
def    1
def    0
xyz    0
xyz    0
xyz    0
xxx    1
zzz    0
  • 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-26T05:07:14+00:00Added an answer on May 26, 2026 at 5:07 am

    I really don’t understand what you’re trying to obtain.
    Anyway I try:

    SELECT DISTINCT word FROM your_table
    WHERE value = 0
    

    If you want to sort words alphabetically, you can do

    SELECT DISTINCT word FROM your_table
    WHERE value = 0
    ORDER BY word
    

    EDITED in response to user comment:
    Try this:

    SELECT DISTINCT word,value FROM your_table
    WHERE word NOT IN
      (SELECT word FROM your_table WHERE value = 1)
    

    or

    SELECT word, SUM(value) as tot FROM your_table
    GROUP by word
    HAVING SUM(value) = 0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am really interested in how MySQL indexes work, more specifically, how can they
I will explain problem with an example: There is two table in my database,
In a project that I'm working, there's a table with a on update trigger,
There is a field in my company's Contacts table. In that table, there is
Is there a way to hide table rows without affecting the overall table width?
Is there any easy way to retrieve table creation DDL from Microsoft Access (2007)
Is there an easy way to create a table in SQL Server (2005) from
Are there any free tools for scripting MSSQL table data? I'll gladly write one,
Is there an easy way to chase down table/stored procedure/function dependencies in SQL Server
Is there explicit support for Single Table Inheritance in Django? Last I heard, the

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.