RE: Within-group aggregate query help please - customers and latest subscription row

2011-10-25 Thread Hal�sz S�ndor
2011/10/24 16:31 -0700, Daevid Vincent WHERE cs.customer_id = 7 GROUP BY customer_id Well, the latter line is now redundant. How will you make the '7' into a parameter? -- MySQL General Mailing List For list archives:

Within-group aggregate query help please - customers and latest subscription row

2011-10-24 Thread Daevid Vincent
I know this is a common problem, and I've been struggling with it for a full day now but I can't get it. I also tried a few sites for examples: http://www.artfulsoftware.com/infotree/queries.php#101 http://forums.devarticles.com/general-sql-development-47/select-max-datetime -problem-10210.html

RE: Within-group aggregate query help please - customers and latest subscription row

2011-10-24 Thread Daevid Vincent
- From: Daevid Vincent [mailto:dae...@daevid.com] Sent: Monday, October 24, 2011 1:46 PM To: mysql@lists.mysql.com Subject: Within-group aggregate query help please - customers and latest subscription row I know this is a common problem, and I've been struggling with it for a full day now but I

RE: Within-group aggregate query help please - customers and latest subscription row

2011-10-24 Thread Daevid Vincent
To: mysql@lists.mysql.com Subject: RE: Within-group aggregate query help please - customers and latest subscription row A kind (and shy) soul replied to me off list and suggested this solution, however, this takes 28 seconds (that's for a single customer_id, so this is not going to scale). Got

Query help please

2010-09-23 Thread Tompkins Neil
Hi all, I've the following query : SELECT fixtures_results.seasons_id , home_teams_id AS teams_id , 1 AS home ,0 AS away , (SELECT SUM(goals) FROM players_appearances WHERE fixtures_results.fixtures_results_id = players_appearances.fixtures_results_id AND players_appearances.teams_id =

Fwd: Query help please

2010-09-23 Thread Tompkins Neil
I wondered if anyone can help me ? Do you need any further information ? Cheers Neil -- Forwarded message -- From: Tompkins Neil neil.tompk...@googlemail.com Date: Thu, Sep 23, 2010 at 9:49 AM Subject: Query help please To: [MySQL] mysql@lists.mysql.com Hi all, I've

Query help, please..

2007-12-11 Thread Anders Norrbring
I'm looking at a situation I haven't run into before, and I'm a bit puzzled by it. I have this table structure: Table USERS: userid, class Table OBJECT: userid, class, result Now I want to query the database for a certain user's result in a specified class, which is very, very easy. No

Re: Query help, please..

2007-12-11 Thread Rob Wultsch
On Dec 11, 2007 8:38 AM, Anders Norrbring [EMAIL PROTECTED] wrote: I'm looking at a situation I haven't run into before, and I'm a bit puzzled by it. I have this table structure: Table USERS: userid, class Table OBJECT: userid, class, result Now I want to query the database for a certain

Re: Query help, please..

2007-12-11 Thread Jason Pruim
On Dec 11, 2007, at 10:46 AM, Rob Wultsch wrote: On Dec 11, 2007 8:38 AM, Anders Norrbring [EMAIL PROTECTED] wrote: I'm looking at a situation I haven't run into before, and I'm a bit puzzled by it. I have this table structure: Table USERS: userid, class Table OBJECT: userid, class, result

Re: Query help, please..

2007-12-11 Thread Peter Brawley
Anders, I also want to find out the user's position relative to others depending on the result. For a given pUserID, something like this? SELECT userid,result,rank FROM ( SELECT o1.userid,o1.result,COUNT(o2.result) AS rank FROM object o1 JOIN object o2 ON o1.result o2.result OR

Re: DELETE query help please?

2007-07-06 Thread Yoge
This should work DELETE Item FROM Item,ItemTag WHERE Item.ProductID =ItemTag.ItemID AND ItemTag.TagID = '168' Mark Kelly wrote: Hi I want to delete from the 'Item' table all the items identified by the folowing query: SELECT Item.ProductID FROM Item, ItemTag WHERE

Re: DELETE query help please?

2007-07-05 Thread Mark Kelly
Hi. On Thursday 05 July 2007 17:35, you wrote: I want to delete from the 'Item' table all the items identified by the folowing query: If you have MySQL 5+, you can do it using a sub-query: DELETE FROM   Item WHERE   ProductID IN ( SELECT     Item.ProductID FROM     Item, ItemTag

DELETE query help please?

2007-07-05 Thread Mark Kelly
Hi I want to delete from the 'Item' table all the items identified by the folowing query: SELECT Item.ProductID FROM Item, ItemTag WHERE ItemTag.TagID = '168' AND ItemTag.ItemID = Item.ProductID; but I'm not sure how to go about it. Can anyone help? Thanks Mark --

RE: DELETE query help please?

2007-07-05 Thread Chris Boget
I want to delete from the 'Item' table all the items identified by the folowing query: If you have MySQL 5+, you can do it using a sub-query: DELETE FROM Item WHERE ProductID IN ( SELECT Item.ProductID FROM Item, ItemTag WHERE ItemTag.TagID = '168' AND

Re: DELETE query help please?

2007-07-05 Thread gary
The following query should work if I understand what you're attempting correctly. Use at your own risk though ;) DELETE FROM Item USING Item, ItemTag WHERE ItemTag.ItemID = Item.ProductID AND ItemTag.TagID = '168'; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql

Bash script array from MySQL query - HELP Please!!!

2007-05-22 Thread Ben Benson
I'm having problems getting a monitoring script to run. I've put the troublesome bit in a separate script just to test, and it goes like this: declare -a HNdeclares the array HN HN=(`echo SELECT url FROM hosts | mysql --user=netmon --password=n3tm0n --skip-column-names

Re: Bash script array from MySQL query - HELP Please!!!

2007-05-22 Thread BJ Swope
I would look at the 15th URL to see if there are specials in there that are breaking the hash somehow. On 5/22/07, Ben Benson [EMAIL PROTECTED] wrote: I'm having problems getting a monitoring script to run. I've put the troublesome bit in a separate script just to test, and it goes like

Problem Query - Help Please

2003-08-29 Thread Paul Maine
When I execute the following query I get duplicate product_id's as shown below: SELECT * FROM product, product_category_xref, category WHERE product_parent_id='' AND product.product_id=product_category_xref.product_id AND category.category_id=product_category_xref.category_id AND

RE: Problem Query - Help Please

2003-08-29 Thread Jim Smith
When I execute the following query I get duplicate product_id's as shown below: SELECT * FROM product, product_category_xref, category WHERE product_parent_id='' AND product.product_id=product_category_xref.product_id AND category.category_id=product_category_xref.category_id AND

mySQL query help please

2002-06-24 Thread Peter M. Perchansky
Greetings: RE: mySQL query help please INSERT INTO Customer_Equipment SELECT Customer.ID, Server_ID, Configuration, Equipment_Type, Group_ID, Location, Rack_Location, Network_Status_Name, Creator_ID, Primary_IP_Address FROM Customer_Equipment, Customer WHERE SUBSTRING(Server_ID, 5,4

RE: mySQL query help please

2002-06-24 Thread Jay Blanchard
[snip] INSERT INTO Customer_Equipment SELECT Customer.ID, Server_ID, Configuration, Equipment_Type, Group_ID, Location, Rack_Location, Network_Status_Name, Creator_ID, Primary_IP_Address FROM Customer_Equipment, Customer WHERE SUBSTRING(Server_ID, 5,4) = Customer.User_ID; The select statement

RE: mySQL query help please

2002-06-24 Thread Peter M. Perchansky
Greetings Jay: RE: mySQL query help please I love rules that don't make sense ;-) So if the end result is to have the records selected appended to the Customer_Equipment table, I have to make a temporary table based on the characteristics of the Customer_Equipment table... then insert from

RE: mySQL query help please

2002-06-24 Thread Jay Blanchard
[snip] So if the end result is to have the records selected appended to the Customer_Equipment table, I have to make a temporary table based on the characteristics of the Customer_Equipment table... then insert from that temporary table. Correct? [/snip] BINGO! Goofy rules can be frustrating

Query help please!

2002-03-05 Thread PinkeshP
I need help writing query that would give me parent categories of catID from categories table. For example, if catID=030 then it should give me: Birthday | Special Birthday | Special Birthday If catID=028 Birthday | General Birthday | NULL desc categories

RE: Query help please!

2002-03-05 Thread Todd Williamsen
Do you have another table with all the birthdates in it? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 12:05 PM To: [EMAIL PROTECTED] Subject: Query help please! I need help writing query that would give me parent categories

RE: Query help please!

2002-03-05 Thread Todd Williamsen
One more thing... What are you using to pull the data? PHP? Perl? Etc? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 12:05 PM To: [EMAIL PROTECTED] Subject: Query help please! I need help writing query that would give me parent