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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:24:57+00:00 2026-06-16T00:24:57+00:00

Imagine that you have a field with data like this (each line represents the

  • 0

Imagine that you have a field with data like this (each line represents the data in that field for different rows):

28746: Porto Alegre
28302: Osasco
28797: Praia Grande

But sometimes there is more than one number in the field:

26755: Floriano Peixoto,26754: Floriano 25582: Bela Vista
25579: Bela Vista 25581: Bela Vista De Goiás,26867: Goiás

I know this data it’s not normalized, but that’s not the issue I want to solve.

I was wondering if it’s possible to make a query that shows only the rows that have more than one number in that field.

Any suggestions on how to achieve that?

UPDATE

From Dark_a answer I tried this:

SELECT data_c1
  FROM test_data
  WHERE INSTR(data_c1,':',1,2) <> 0;

But it seems that INSTR only accepts to arguments:

http://dev.mysql.com/doc/refman/5.5/en/string-functions.html

However if I use this other query:

SELECT data_c1
  FROM test_data
  WHERE INSTR(data_c1,',') <> 0;

It seems to work fine, because the data in fields with more than one number, it’s separeted by a comma.

  • 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-16T00:24:58+00:00Added an answer on June 16, 2026 at 12:24 am

    You can try this:

    SELECT data_c1
      FROM test_data
     WHERE INSTR(data_c1,':',1,2) <> 0;
    

    If comma is used in text. if not then is better to check for comma:

    SELECT data_c1
      FROM test_data
     WHERE INSTR(data_c1,',',1,2) <> 0;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data which I am formatting like this: // ... imagine populating
I have a field that contains data like below: 124.97#54.03#5#16 its number which separated
I have SQL data that looks like this: events id name capacity 1 Cooking
I would like to ask you: Imagine that you have a site and there
Do input field NAMES have to be unique across forms? I would imagine that
Imagine that you have to query the database in order to retrieve some data
I would like to have a zipcode input field that listens when 5 characters
Ok, let's imagine I have an object like this: public class User { public
Imagine that I have a form in a flash application with two fields, input1
Imagine that I have a nice Deck class, in the best OO fashion. It

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.