Re: Still bugging me..
| From: | Hans H. Anderson | Date: | Fri, 11 Aug 2000 20:24:44 +0000 |
| Subject: | Re: Still bugging me.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-11414@lists.php.net to get a copy of this message | ||
David,
Are all of these queries coming from the same database? If so, could you
be using a join of some sort? I prefer natural joins, but even a union
would probably (maybe, maybe, maybe) be more efficient than what you are
doing.
Hans
On Fri, 11 Aug 2000, David VanHorn wrote:
>
> I have the results of three mysql queries, which may contain zero or more
> (or many many more) records.
> I'm trying to find an efficient way to trim this set and only look at those
> which have one field in common.
>
> IOW:
>
> After three queries, I have these sets:
>
> $Result_A
> $Result_B
> $Result_C
>
> Each has a field called reference, (plus several other fields) and the
> records within Result_A might have reference = 10,11,12,13. Result_B might
> have reference = 11,12,13,14, and $Result_C might have reference =
> 12,13,14,15,16
>
> What I want is to discard, or to only pay attention to the records where in
> this case, reference is 12 or 13.
> The problem is that I have to search on other fields in the records to find
> out which are potentially interesting.
>
> I do need all the data for the congruent set though, not just the reference
> numbers, although I suppose I could then re-fetch them, but it seems a waste.
>
> In some cases, these may be large sets, so I really don't want to loop
> through. If each returned 1000 records, then the result would be a
> frighteningly large search.
>
> --
> Where's dave?
> http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>
Hans Anderson ~ me@hansanderson.com
PO Box 426, Missoula, MT 59806 | PHP, Search Engines, SQL
(800)397-9116 / (406)549-6524 | Databases, Flash Multimedia,
http://www.hansanderson.com | Killer Audio Production,
http://www.goofiness.com | Minty Fresh Breath.