[thelist] Quick SQL help...
Ken Moore
psm2713 at hotmail.com
Wed Aug 30 19:32:06 CDT 2006
Hi all,
Rob Smith wrote,
>
>Is there an easy way to find a list of SKU's that remotely match another
>one in the list? The sample result might look like:
>
That depends on your definition of "easy." It also depends on whether or not
you need to include the whole SKU. If so, it is easy using the like
operator:
WHERE PossibleMatch LIKE %ThisSKU%
If you need only match a fraction of the SKU, then it is not easy. I will
use PHP seudo code.. First you need to decide how many charters will
constitute a mach. Then loop thru that many minus the total length.
$LengthToMatch = 5
for ($i = 0, $i = sizeof(ThisSKU) - $LengthToMatch, $I++) {
$ThisTry = assign the substring from $i for $LengthToMatch chars
if ($ThisTry == $ItemToMatch) {
Do something;
}
}
Notes:
1. The above is for one item to match. If there is a list, you will need a
for loop to get all of them.
2. It has been a while since I have used PHP and all of my books oar on
loan. Sorry!
Ken
>
>SKU Match
>
>ABC123 EPSABC123
>
>DFE332 EPSDFE332
>
>
>
>Thanks,
>
>
>Rob Smith
>LexJet
>rob.smith at lexjet.com
>http://www.lexjet.com
>(800)453-9538
>(941)330-1210 Int'l
>(941)330-1220 Fax
>1680 Fruitville Road, 3rd Floor
>Sarasota, FL 34236
>
>--
>
>* * Please support the community that supports you. * *
>http://evolt.org/help_support_evolt/
>
>For unsubscribe and other options, including the Tip Harvester
>and archives of thelist go to: http://lists.evolt.org
>Workers of the Web, evolt !
_________________________________________________________________
Search from any web page with powerful protection. Get the FREE Windows Live
Toolbar Today! http://get.live.com/toolbar/overview
More information about the thelist
mailing list