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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:20:17+00:00 2026-05-27T00:20:17+00:00

I got a database with multiple fields and about 10000 entries. I only need

  • 0

I got a database with multiple fields and about 10000 entries. I only need to check for the appearance of 4 different strings in one field.

Example:

id--name--sex--color--size--weight--price--points--class--
1   pet   m    white  180   90      120    1000    low
2   bob   m    white  180   90      110    2000    high
3   foo   m    white  180   90      120    3000    low
4   boo   m    white  180   90      140    1000    low
5   bla   m    white  180   90      100    2000    medium
6   blu   m    white  180   90      120    5000    lala    

Basically there are 3 classes, but sometimes I have a custom class. Now I want to search my whole DB for the appearance of low, high and medium. It might be that there is no entry for one or more of them. Also I need to check whether there is a custom (unknown) class.
It’s enough to know whether they appear, I don’t need any more data.

All I came up with is just querying the field class and then searching with phps in_array(), but I guess that’s just a waste of resources.

Can someone help me here please ? How do I query this clever without querying all the results?

  • 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-27T00:20:17+00:00Added an answer on May 27, 2026 at 12:20 am

    Let database find only distinct values from class column. Your keyword is ‘distinct’.

    select DISTINCT class from table;
    

    Anyway if you care I would recommend reading something about database table normalization and improving the table design.

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

Sidebar

Related Questions

I've currently got a database with about 20 reference tables, i.e. stuff like products,
I've got a form with multiple fields on it (company name, postcode, etc.) which
I got an issue with users rapidly pressing my UIButton causing multiple entries being
I've got an in-memory dataset with several fields, one of which is a primary
I've got an MS SQL database with 3 inherent tables. A general one called
I need some help to figure out how to add multiple fields, on a
I've got a question about the possibility to create nested fields in solr. Google
We've got the following scenario: Central Database (replicated across multiple servers) Client Database 1
I've got a SQL query running a FULL JOIN on multiple database tables. The
I've got a database which I intend to replicate for backup reasons (performance is

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.