[nycphp-talk] more queries, or bigger in-memory data structure ?
David Mintz
dmintz at panix.com
Thu Sep 18 17:03:20 EDT 2003
Dan,
I believe I do follow you and I don't think it would do for me (or, it
would work, and I do not understand you (-:).
If two successive 'subitems' are different, I want to concatenate the
fields that are different and display then in one cell in one row.
Let's say the result set looked like this
Judge Language Defendant Interpreter
------------------------------------
Jones Spanish Estrada Mirta
Jones Spanish Estrada Elena
...then I want to display
Judge Language Defendant Interpreters
---------------------------------------
Jones Spanish Estrada Mirta, Elena
...because that's what makes sense to the user. Zat make any sense?
Thanks,
David
On Thu, 18 Sep 2003, Analysis & Solutions wrote:
> Hey David:
>
> On Thu, Sep 18, 2003 at 03:34:11PM -0400, David Mintz wrote:
> >
> > So even if I
> > could figure out the LEFT JOIN syntax to left-join multiple tables in this
> > way, if such is possible, it still wouldn't give me what I want.
>
> With clever looping and comparisons, I bet you could get what you want
> with one query.
>
> For exapmle, I've made some calendars where the items are ORDER BY
> EventDate, StartTime. I then loop through the results. Before starting,
> a variable named $LastDate is set to the date of the first record and a
> date header is printed out. While looping through, before displaying each
> record, the $LastDate is compared to the current event date. Once the
> dates are different, then the next date header is printed.
>
> See http://www.bikesummer.org/calendar/ to see what I mean.
>
> Similarly, you can use this principle to handle multiple sub-items. Like,
> printing the Interpreter and Defendants only when the name changes.
>
> Am I writing this clearly?
>
> --Dan
>
> --
> FREE scripts that make web and database programming easier
> http://www.analysisandsolutions.com/software/
> T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
> 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>
---
David Mintz
http://davidmintz.org/
Email: See http://dmintzweb.com/whitelist.php first!
"Y dále p'abajo"
Tito Rojas
More information about the talk
mailing list