Mysql query that returns only records that start with a particular chunk

Asked

Viewed 23 times

-2

I have a field in my table where the entered data is processed directly in PHP. The value of this field is concatenated to allude to the first record with a similar start.

Example:

  • first record is inserted with code 1;

  • the record referring to it will have code 1.1, 1.2 and so on.;

The problem is that at query time, if there are records 11.1, it ends up grouping with record 1.

Can you help me with this question? I need to return the values that are only part of the first part of the decimal place.

Excerpt from the SQL:

AND Codigo LIKE '".$Codigo'."%' ";

Thanks a lot!

1 answer

0

I don’t quite understand your question, come on. What do you need? Ex. Field 1.1 1.2 1.3 1.4 ... 2.1 2.2 2.3 2.4 ... 11.1 11.2 11.3 11.4

These are the table fields, what do you go through to be searched? What do you need to find? Pass me that data to try to help you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.