This question involves table setup questions as much as it involves a
query question. Bare with me, this seems hard to explain.

I have a table that includes records with 3 (relevant to this
conversation) fields (actually 9..more on that later). Each of those
fields have 2 other related fields. i.e..

Field Special 1 has a related field with a Start Date and another field
for End date.
Field Special 2 has a related field with a Start Date and another field
for End date.
Field Special 3 has a related field with a Start Date and another field
for End date.

I will probably need to add up to 3 other fields to keep track of the
last shown date.

Anyhow, I need to build a query that will return 5-10 "Specials". I want
to output this very much like an ad banner query would. That is to say,
I need to keep track of the last one that was shown and output the next
one. What complicates this is that there are UP TO to 3 specials per
record. Some of them may not include any specials at all. Some may have
1 or 2. Special 1 should be shown before Special 2. etc. Only 1 Special
from each record should be output. i.e.. Special 1 and Special 2
shouldn't be output from record #1. (Actually I would like to have that
occur if there are not 5-10 other results.. but I can live without
that..)

The question:
Is there anyway I build a single query to accomplish this? Since this is
in the early design mode, I can add/delete any current fields and build
it differently as needed. Alternately, I could just randomly output 1
special from each record that has one..I'd prefer the other method
though...

I just need some advice from some people who are more fluent in sql :)

TIA!


---------------------------------------------------------------------
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