Re: SELECTing to Substitute Text for Refc Codes

2004-05-25 Thread Greg Willits
Got an offline answer, so I'm all set. Gotta love SQL. for posterity... Try: SELECT cn.name, cd1.desc ,cd2.desc FROM contact AS cn, codes AS cd1 codes AS cd2 WHERE cn.city = cd1.code AND cn.state = cd2.code given: CREATE TABLE `codes` ( `id` int(11) NOT NULL auto_increment, `code` varchar(16)

Re: SELECTing to Substitute Text for Refc Codes

2004-05-25 Thread Roddie Grant
For posterity (ie the archives) there's a comma missing in the FROM line: FROM contact AS cn, codes AS cd1, codes AS cd2 Roddie Grant on 25/5/04 8:25 am, Greg Willits at [EMAIL PROTECTED] wrote: Got an offline answer, so I'm all set. Gotta love SQL. for posterity... Try: SELECT

SELECTing to Substitute Text for Refc Codes

2004-05-24 Thread Greg Willits
Struggling with a query structure new to me... Most of my apps are not very complex at all (simple joins, few functions), but I've worked through a few tricky queries. However, this one is stumping me on how to even begin. I can't even decide what kind of query it is. As you can I wasn't even