[PHP-DB] MySQL Query Help

2006-03-23 Thread Mark Dyer
Hello, I'm unsure how to write the follow query, Please can someone assist. I am writing in short hand the basis of the two queries I would like to combine. The object is to select all the products that have not meet the min sale requirements so I can send myself a reminder email. The first

[PHP-DB] MySQL Query help please!

2003-03-12 Thread Griffiths, Daniel
Hi all, I have 2 tables that I need to extract data from, say PORTS and STATS. PORTS contains a list of Sea Ports in PORT i.e. : - PORTS.PORT UK FRANCE GERMANY NETHERLANDS SPAIN ITALY STATS contains a few thousand records that with among other things has the elements

Re: [PHP-DB] MySQL Query help please!

2003-03-12 Thread Mark
I just set up a test db using your info, and the query you have worked ok. It provided a zero. Here's what I have (slightly modified from yours, but not appreciably). select ports.port, sum(stats.amount) as Total from ports left join stats on ports.port=stats.to_port group by ports.port order by

RE: [PHP-DB] MySQL Query help please!

2003-03-12 Thread Griffiths, Daniel
Message- From: Mark [mailto:[EMAIL PROTECTED] Sent: 12 March 2003 15:36 To: Griffiths, Daniel Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MySQL Query help please! I just set up a test db using your info, and the query you have worked ok. It provided a zero. Here's what I have (slightly modified

[PHP-DB] MySQL query help - limit and group by

2002-02-25 Thread Faye Keesic
Hi there. I would like to return the 2 most recent events from my table, for each author (Author_ID). Here's my table structure (simplified). tblEvents ID Title Create_Date Author_ID Is there a way to do this with a query instead of getting every record, sorted by Author_ID, displaying the

Re: [PHP-DB] MYSQL query help

2001-12-14 Thread Miles Thompson
It's not the IN, it's the sub-query you cannot use. MySQL doesn't support them and it's just about the main reason I don't like it. Alternatives? You could execute your subquery and return the results to an array. Loop through the array, using the index and the indexed element to drive a

[PHP-DB] MYSQL query help

2001-12-14 Thread Harpreet
I dont think we can use 'IN' and 'NOT IN' in mysql. Is there an alternative that would work? select * from lib_asset_tbl where material_id '' and asset_id in (select asset_id from lib_copy_tbl) Help is appreciated. Regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -- PHP