stewartship wrote:Sorry could
i am a little confused as substring(param,3) extracts the first three characters from param (i.e. par but)
Oh I didn't say param is a column name of myTable4.
It's values are like the following.
(Third record and eightth record have long values.)
c=4
c=2
n=41&k=5
c=1
n=5
c=2
c=2
n=1&cate=6
c=2
n=7
c=1
Let's remove "c" because SQL says left(param,1)='n'
Then the following will be remained.
n=41&k=5
n=5
n=1&cate=6
n=7
Now let's make substring(param,3) because SQL says substring(param,3)=myTable1.n
I guess it will be like the following.
41&k=5
5
1&cate=6
7
Now let's see myTable.n which has the same value with among the just above.
The record COLOR=Red Peking[/COLOR] and the record COLOR=Red Paris[/COLOR] will be retrieved.
But I don't know why COLOR=Red Tokyo[/COLOR] and COLOR=Red Chicago[/COLOR] are retrieved.
41&k=5 is different from B Chicago[/B] and 1&cate=6 is also different from B Tokyo[/B].
The only the first part of 41&k=5 are same with B Chicago[/B].
The only the first part of 1&cate=6 are same with B Tokyo[/B].
Do you see why Tokyo and Chicago are retrieved although only the first part of their values are same with N value of myTable1.
Or
Do you see something wrong in my development?