Re: [PHP-DB] List for SQL questions?
On Sat, Mar 24, 2001 at 06:40:09AM +0100, Martin Skj?ldebrand wrote: > 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. I think this is an appropriate list, but since you are using Mysql, you might want to try asking @ [EMAIL PROTECTED] I can try to help, but unfortunately, I will have to see the table structure so I can actually understand what you are trying to accomplish. -- Jason Stechschulte [EMAIL PROTECTED] -- Tactical? TACTICAL!?!? Hey, buddy, we went from kilotons to megatons several minutes ago. We don't need no stinkin' tactical nukes. (By the way, do you have change for 10 million people?) --lwall -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] List for SQL questions?
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]