0

I have column call: customer_mobile. but inside that cell they have data like

'0875555555,0875555555,0875555555,0875555555,0875555555' .

I want query if data duplicate will show 1

4
  • what do you mean with duplicate? You want to see if there are more than one number inside the cell? Commented May 4, 2018 at 9:44
  • 2
    you should consider to normalize your db. This is a really poor database structure for what I can see Commented May 4, 2018 at 9:44
  • There is no easy way to do this in mysql google mysql unstrng or mysql split string for ways to explode strings. Commented May 4, 2018 at 10:03
  • @P.Salmon . I Already got it Thank bro. Commented May 4, 2018 at 10:31

1 Answer 1

1

You can find specific string in comma separated strings like this

SELECT FIND_IN_SET('0875555555', (SELECT customer_mobile FROM your_table_name)) as found

It will return position like 1,2,3,4 if found otherwise it will return 0

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.