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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:23:57+00:00 2026-06-12T19:23:57+00:00

I have got a mysql table structure: uid company value Description: uid -> unical

  • 0

I have got a mysql table structure:

uid     company     value

Description:
uid -> unical id
company -> four letters code of company ie. AAAA, BIEW
value -> is a code of two different type of data: country or region, where:
country: "/[0-9]+\-/", ie. 49-, character at the end - means this is a region value
region: "/[0-9]+\_[0-9]+/", ie. 49_002 , 49_4, character _ means this is a country value

Now I want to SELECT all records WHICH:

  • has a multiple company definitions, ie. AAAA' OR 'BIEW'
  • has a multiple country definitions, ie. '49-' OR '5698-'
  • first of countries above has specified region. I wan to search 49_01 only but not 49_03 and 49_965, which also “belongs” to 49- country
  • second of countries '5698-' don’t have specified regions and should return only records where value='5698-'

The AAAA company has ‘filter’ that specify country/region records but BIEW has not any specified country/region values. The MYSQL query don’t work properly:

SELECT * FROM `table` WHERE (company='AAAA' OR company='BIEW') AND (value='5698-' OR value='49_01')
  • 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-12T19:23:59+00:00Added an answer on June 12, 2026 at 7:23 pm

    If I understand

    SELECT * 
    FROM `table` 
    WHERE tourOP = 'AAAA' AND (val = '5698-' OR val = '49_01') OR tourOP = 'BIEW'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got a table structure in mysql like this: ________________________ | id |
I have got a mysql table containing data about companies: id, company name, city,
I have got a simple MySQL table and primary index (id) is not numbered
i have got a problem with my SQL Statement: Table structure: CREATE TABLE tags
I have got a field in mysql table with the type SET and collation
I am learning to use mysql.So, I got some problems. I have three table
So, I have got following data in a MySQL table: mysql> SELECT * FROM
I have got a Mysql (5.1.58-1ubuntu1) 'users' table ( InnoDB storage engine, utf8 general
I have got a table in my MySql database: pageid | text -----------+---------- 1
I am programming in PHP mysql. I have recently got into OOP programming. So

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.