Hi,

how about

select fname, c1.cname, c2.cname, c3.cname from 
firms, 
cityname as c1,
cityname as c2,
cityname as c3
where
first.city0 = c1.id and
first.city1 = c2.id and
first.city2 = c3.id;

CC'ing the dialogue to the list lets us know that you have received the
first reply, and what you made of it, allowing others, like me, to suggest
other solutions.

Regards

Quentin

-----Original Message-----
From: Gábor Lénárt [mailto:[EMAIL PROTECTED]]
Sent: Friday, 26 January 2001 09:20
To: Gerald L. Clark
Cc: [EMAIL PROTECTED]
Subject: Re: simple SQL question


On Thu, Jan 25, 2001 at 12:52:11PM -0600, Gerald L. Clark wrote:
> I would suggest not having 2 cities in your firm record, and making
> fname,city your key.
> 
> select * from firms order by fname,city would give you.
> A+B company   Dallas
> A+B company   London
> New systems Ltd       New York
> New systems Ltd       Paris


Nice, but it has got some problems. If I correctly understand you, you
suggest me to double records which have got multiple city entries.
The problem is that firms table has got many fields even binary ones
to hold picture data so it would be expensive to double them.
And my other problem: indexing character types are more slower than just
bigint
values. By the way is there any ANSI SQL solution for it? I mean only in
mySQL
can't be implemented simply or this is a general SQL problem?

PS: Maybe I should stop CC'ing this thread to the list, shouldn't I.

- Gabor Lenart

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
The information contained in this email is privileged and confidential
and intended for the addressee only. If you are not the intended 
recipient, you are asked to respect that confidentiality and not 
disclose, copy or make use of its contents. If received in error 
you are asked to destroy this email and contact the sender immediately. 
Your assistance is appreciated.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to