Assistance on Query
| From: | Shannon Doyle | Date: | Sun, 16 Jan 2005 13:39:50 +0000 |
| Subject: | Assistance on Query | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-38154@lists.php.net to get a copy of this message | ||
Hi People,
I would like some assistance on the following scenario.
I have to pull out all records for a particular userid (easy enough) and
then only show those entries where the follwing occurs.
These records from the table will contain either an entry in the
services_type field or the non_services_type field. What I need to do is
show only those where the number of consecutive records that contain an
entry in the non_services_type field is greater than or equal to 3
so example:-
record 1 contains an entry in non_services_type
record 2 contains an entry in services_type
record 3 contains an entry in non_services_type
record 4 contains an entry in non_services_type
record 5 contains an entry in non_services_type
record 6 contains an entry in services_type
so I would need to display records 3,4,5 only
Can anyone assist me with this?
Cheers,
Shannon