I was just wondering if anyone could tell me how to do a search for a partial data match. Say one data field is 123, 234, 345, 456 and another is 111, 222, 333, 444 and another is 555, 666, 777, 888 and I want to search for the unique number 234 but not the whole number 123, 234, 345, 456 ... is there any way to do that or does every search have to be exactly like the data in the field?
Thanks for any help.
Dennis
yeah. UseSELECT
...
FROM
<table>
WHERE
<colname> = <Value>
|||
Look in Books on Line for the LIKE operator. Using wildcards (%), you can find what you're looking for.
Select field1 from table1 where field1 LIKE '%234%'
|||Why are you storing multiple values in a single column? You should get a book on database design -- such asthis one -- and design your databases such that you don't have to play games with text parsing.|||
I have to add this ability to an existing application that is accessing the DB from a Visual Studio Web Api. I realize that I could use one field for each data entry but the existing api has only one field to enter all the sub order data into the DB and I don't have time to rewrite the whole program. In the future, I will update this so that there is a seperate table for this function but right now I just need to figure out a workaround. Also, for this api there could be anywhere from 2 to 200 entries which is why it was written that way in the first place. See example:
Order Number: 12345
Sub Order Numbers: 2345, 5654, 923827, 00o09p87, 537654, w54327653, d54637364, u76y76tt, 6272527jhyr, ...... etc
I am trying to figure out a way to come up with the Order Number when only one of the Sub Order Numbers is available. Also, I have no control over how many or when the Sub Order Numbers are entered. The end users will be from a large variety of businesses and they are only aware of the Sub Order Number that is for them.
Thanks for all the speedy replies and please keep them comin'!
Dennis
No comments:
Post a Comment