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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:13:56+00:00 2026-05-21T22:13:56+00:00

Grandfathered Database, worst non normal form data I’ve ever witnessed. So queries become a

  • 0

Grandfathered Database, worst non normal form data I’ve ever witnessed. So queries become a pain the arse.

I’m trying to match to see if the field is NOT either of these two strings..I’ve googled my arse off and the REGEXP function isn’t all that great.

IF (SUBSTRING_INDEX(op.field_name, '-', 1) != ('CAT','DOG'),
    ps.products_productline ,SUBSTRING_INDEX(op.fieldname, '-',
    1)) AS product_type

The substring index are either Cat, Dog or a Unique string.

  • 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-21T22:13:57+00:00Added an answer on May 21, 2026 at 10:13 pm
    Case
    When SUBSTRING_INDEX(op.field_name, '-', 1) Not In('CAT','DOG') Then ps.products_productline
    Else SUBSTRING_INDEX(op.fieldname, '-', 1)
    End AS product_type
    

    Another solution

    Case
    When op.field_name Like 'CAT-%' Then 'CAT'
    When op.field_name Like 'DOG-%' Then 'DOG'
    Else ps.products_productline
    End AS product_type
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume that the following facts are already entered into the Prolog database: father(X, Y)
I got data which is from father(adam, matt). father(matt,frank). father(frank,jim). grandfather:-father(X,A),father(A,Y). How do I
I'm trying to create a loggers hierarchy in my application. (I'm using standard java
I'm loading horse genealogical data recursively. For some wrong sets of data my recursion
I can't understand that part, neither trying the showcase examples. I'm using an extension
Why 1753? What do they have against 1752? My great great great great great
I am working on the following page: www.darksnippets.com It looks good on FF and
So, the object model is rather complex and hierarchical. Grandfather accepts is created by
I have a field type in a model called user which is an int
I want to create a multi-level JSON string with JS. Scenario 3 countries with

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.