![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Dear All, I had this records below: ACode 80 81 817 8171 82 The parameter variable value is '817145779' what is the SQL statement for getting '8171' |
|
please help Thanks a lot in advance & Regards Winanjaya |
#3
| |||
| |||
|
|
In article <4434e753.1a82.1681692777 (AT) sybase (DOT) com>, Winanjaya says... Dear All, I had this records below: ACode 80 81 817 8171 82 The parameter variable value is '817145779' what is the SQL statement for getting '8171' We need a lot more information to help you, especially what is the criteria which decide that 8171 is the proper result? yes, 8171 is the proper result, because I am soft seeking |
|
ACode 80 81 817 8171 ---> this is the most accurate pattern for 817145779 82 |
#4
| |||
| |||
|
|
In article <4434e753.1a82.1681692777 (AT) sybase (DOT) com>, Winanjaya says... Dear All, I had this records below: ACode 80 81 817 8171 82 The parameter variable value is '817145779' what is the SQL statement for getting '8171' We need a lot more information to help you, especially what is the criteria which decide that 8171 is the proper result? yes, 8171 is the proper result, because I am soft seeking '817145779' and '8171' has the most accurate pattern .. as you see in this record list below: ACode 80 81 817 8171 ---> this is the most accurate pattern for 817145779 82 hopefully you understand what I need .. Thanks a lot in advance Regards Winanjaya |
#5
| |||
| |||
|
|
In article <4434e753.1a82.1681692777 (AT) sybase (DOT) com>, Winanjaya says... Dear All, I had this records below: ACode 80 81 817 8171 82 The parameter variable value is '817145779' what is the SQL statement for getting '8171' We need a lot more information to help you, especially what is the criteria which decide that 8171 is the proper result? yes, 8171 is the proper result, because I am soft seeking '817145779' and '8171' has the most accurate pattern .. as you see in this record list below: ACode 80 81 817 8171 ---> this is the most accurate pattern for 817145779 82 hopefully you understand what I need .. Thanks a lot in advance Regards Winanjaya |
#6
| |||
| |||
|
|
In article <4434e753.1a82.1681692777 (AT) sybase (DOT) com>, Winanjaya says... Dear All, I had this records below: ACode 80 81 817 8171 82 The parameter variable value is '817145779' what is the SQL statement for getting '8171' We need a lot more information to help you, especially what is the criteria which decide that 8171 is the proper result? yes, 8171 is the proper result, because I am soft seeking '817145779' and '8171' has the most accurate pattern .. as you see in this record list below: ACode 80 81 817 8171 ---> this is the most accurate pattern for 817145779 82 hopefully you understand what I need .. Thanks a lot in advance Regards Winanjaya |
#7
| |||
| |||
|
|
I did something kinda similar once - converting from Foxpro to a relational database and users wanted to list of stuff above and below what the entered. Not because it was useful, but because that is the way it worked before..... Anyway, you could do the following in a procedure: Do a like and append a '%' to the parm. If you get zero rows, remove one character from the end and try again. Keep going in a loop until you get at least one row that matches the like. Without using a procedure, you may also be able to do a like to get the max record that matches the parm assuming Acode is your column name this may work: select max(Acode) where Acode||'%' like arm (may need to be switchedaround to arm like Acode||'%' ).I haven't tried this specifically so I'm not sure if it works. winanjaya> wrote in message news:4435357c.71ea.1681692777 (AT) sybase (DOT) com... >> In article 4434e753.1a82.1681692777 (AT) sybase (DOT) com>, >> > Winanjaya says... Dear All, I had this records below: ACode 80 81 817 8171 82 The parameter variable value is '817145779' what is the >> > SQL statement for getting '8171' We need a lot more information to help you, especially what is the criteria which decide that 8171 is the proper >> result? yes, 8171 is the proper result, because I am soft seeking '817145779' and '8171' has the most accurate pattern .. as you see in this record list below: ACode 80 81 817 8171 ---> this is the most accurate pattern for 817145779 82 hopefully you understand what I need .. Thanks a lot in advance Regards Winanjaya |
![]() |
| Thread Tools | |
| Display Modes | |
| |