lespritdelescalier
Registered User.
- Local time
- Today, 14:59
- Joined
- Mar 16, 2015
- Messages
- 50
I am trying to read data from a table created by another application developer. In the table, there is a field for Part IDs. This field can have one or many Part IDs in it. If there are more than one, each Part ID is separated by a comma.
My issue is that we have similar Part IDs, and that using LIKE in a SQL statement will not necessarily return the result that I need. An example would be as follows:
My search criteria: 1234
Field value: 1111,1222A,1233,1234A,1235
If I use LIKE, the SQL statement will return a result, but I don't want it to because it doesn't exactly match one of the Part IDs. I have attempted to add commas to the ends of the search criteria, but the SQL statement fails to return results. It also won't handle situations where the Part ID is first or last in the field.
I would like to recommend to the application dev that the table be normalized, or that two tables be used (one with the rest of the tables details, and one that links the Part IDs to each record). This will require some redevelopment and delay the release of the other application, but I would like things to be set up correctly.
Thanks for any feedback that you might have!
My issue is that we have similar Part IDs, and that using LIKE in a SQL statement will not necessarily return the result that I need. An example would be as follows:
My search criteria: 1234
Field value: 1111,1222A,1233,1234A,1235
If I use LIKE, the SQL statement will return a result, but I don't want it to because it doesn't exactly match one of the Part IDs. I have attempted to add commas to the ends of the search criteria, but the SQL statement fails to return results. It also won't handle situations where the Part ID is first or last in the field.
I would like to recommend to the application dev that the table be normalized, or that two tables be used (one with the rest of the tables details, and one that links the Part IDs to each record). This will require some redevelopment and delay the release of the other application, but I would like things to be set up correctly.
Thanks for any feedback that you might have!
Last edited: