Reverse pattern matching

From: Gary Greenberg <gary.greenberg_at_intel.com>
Date: Tue, 17 May 2005 17:12:40 -0700
Message-ID: <d6e19o$rbj$1_at_news01.intel.com>



I encountered an unusual problem and wonder if anyone had some similar experience. I have a table T where the column contains text values with wild cards and a query contain exact value. For example

| A | B |


|AB% | 1 |
|X% | 2 |
|XY% | 3 |
|% | 4 |

I'd like to make a query "select B from T where A like 'XYZ'" I need to get a result sorted by maximum matching. For the liset case it should be:
3
2
4

Any help will be greatly appreciated. Received on Wed May 18 2005 - 02:12:40 CEST

Original text of this message