Reply to Re: Join returns more than one row, Post code regular expressions

Your name:

Reply:


Posted by cheesey_toastie on 03/23/06 15:54

Hi Damien,

I was first initially dubious that it would work where the post code
matched three different rows e.g.

If postal_code = MK111 1AA ....
MK%
MK1%
MK11%

But it does, and a quick read of
http://www.techonthenet.com/sql/exists.php explained it.
Thanks for that!

Below is the code with the minor corrections of the field names for
anyone following the post...
SELECT dn.DEALER_CODE, dn.NAME AS DNAME, rc.REGION_ID,
rc.POST_CODE, dn.POSTAL_CODE
FROM REGIONAL_CODES rc CROSS JOIN
DEALER_NAW dn
WHERE (dn.POSTAL_CODE LIKE rc.POST_CODE) AND (NOT EXISTS
(SELECT *
FROM REGIONAL_CODES rc2
WHERE dn.POSTAL_CODE LIKE
rc2.POST_CODE AND LEN(rc2.POST_CODE) > LEN(rc.POST_CODE)))

ct

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация