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:
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
-
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
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
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 =
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
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
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
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
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
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
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
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
--
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
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
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
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
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
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
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
[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
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
[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
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
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
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
26 matches
Mail list logo