Question : SQL Select problem...need records with "best match" returned in order

Here is an example of one of the select statements that I have going on...
SELECT * FROM CurrentSalesList WHERE Title = 'ATLANTIC' OR UnivCode = 'ATLANTIC' OR Title LIKE '%ATLANTIC%' OR UnivCode LIKE '%ATLANTIC%' OR Title LIKE '%A%T%L%A%N%T%I%C%' OR Title LIKE 'ATLANTIC%' OR Title LIKE '%ATLA%'

....I ordered my WHERE clause in the order i'm checking for a match, however, the results are going to be returned in the order in which they are found....... example... if %A%T%L%A%I%C%  is found in "Appletown Lake North Inc" , and that record comes before a record that has a closer match... "ATLANTIC SHORES".... then i'm getting the wrong record.

How can I order the records with the "best match" ?...
Any other options ?

Stored procedure maybe ?

Answer : SQL Select problem...need records with "best match" returned in order

SELECT * FROM
(
SELECT *, 1 AS Rank FROM CurrentSalesList WHERE Title = 'ATLANTIC'
UNION ALL
SELECT *,2 FROM CurrentSalesList WHERE  UnivCode = 'ATLANTIC'
UNION ALL
SELECT *,3 FROM CurrentSalesList WHERE  Title LIKE '%ATLANTIC%'
UNION ALL
SELECT *,4 FROM CurrentSalesList WHERE  UnivCode LIKE '%ATLANTIC%'
UNION ALL
SELECT *,5 FROM CurrentSalesList WHERE  Title LIKE '%A%T%L%A%N%T%I%C%'
UNION ALL
SELECT *,6 FROM CurrentSalesList WHERE  Title LIKE 'ATLANTIC%'
UNION ALL
SELECT *,7  FROM CurrentSalesList WHERE  Title LIKE '%ATLA%'
)A
ORDER BY RANK DESC
Random Solutions  
 
programming4us programming4us