[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-db
Subject:    [PHP-DB] List for SQL questions?
From:       Martin =?ISO-8859-1?Q?Skj=F6ldebrand?= <chimbis () skjoldebrand ! org>
Date:       2001-03-24 5:40:09
[Download RAW message or body]

Anyone knows a list for discussion SQL questions?

On the off chance that this *is* an appropriate list here goes:
I want to select tickets from two tables that registers support tickets and 
events related to the ticket. No problem.

Tickets go through various stages, REGISTERED, OPEN, CLOSED in events
one ticket can have several entries with one of all three stages on each 
row. And can have a technician assigned (field gives username) or be not 
yet assigned to someone (Not Assigned).

Now, I want to select ONLY the ticket that meets Registered *AND* Not 
Assigned. And this should be the final status of the ticket. (All tickets 
may have this status at one time or another).

I've tried:

"SELECT ticket.t_id, t_client, t_summary, e_assignedto, e_status FROM 
ticket, events WHERE e_status = 'REGISTERED' AND e_assignedto = 'Not 
Assigned' AND ticket.t_id = events.t_id";

This gives me ALL hits on this string. Including tickets that have had the 
desired status but is now assigned to someone.

Any suggestions? I'm using MySQL as a database.
Apologies if this is an unappropriate list - and grateful for pointers to 
the correct forum.

M.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic