473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

What Is Wrong With This query?

Update garment_details
SET garment_details.blankprice = '1.50'
Where garment_details.GarmentDetailID
in (Select
garment_details.GarmentDetailID
From garment_details
Inner Join colors ON garment_details.ColorID =
colors.ColorID
Where
colors.ColorType = '1' AND
garment_details.GarmentID = 'fol3930r'
)

Mar 9 '06 #1
1 1226
"kevinjbowman" <ke**********@gmail.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Update garment_details
SET garment_details.blankprice = '1.50'
Where garment_details.GarmentDetailID
in (Select
garment_details.GarmentDetailID
From garment_details
Inner Join colors ON garment_details.ColorID =
colors.ColorID
Where
colors.ColorType = '1' AND
garment_details.GarmentID = 'fol3930r'
)


It would be helpful when posting question if you would include details about
your environment and the symptoms of any error.
For instance, is this query causing an error? What is the error?
Or does it function correctly, but too slowly?
Or do you just want to know if it's good SQL coding style?

My guess is that you're using MySQL 4.0 or earlier, which doesn't support
subqueries. If so, you're getting a syntax error near where the "(Select"
subquery begins.

If you're using at least 4.0.4, you can try this instead:

UPDATE garment_details g INNER JOIN colors c ON g.ColorID = c.ColorID
SET g.blankprice = '1.50'
WHERE g.GarmentDetailID = 'fol3930r' AND c.ColorType = '1';

This uses multi-table update syntax, which is an extension to SQL that MySQL
offers. It isn't standard SQL, but it's very useful.

Regards,
Bill K.
Mar 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steve | last post by:
Hi, Is there something fundamentally wrong with the following query? SELECT MAX(OrderID) AS Expr1 FROM Orders WHERE (MarketActionCode = 'S') AND (OrderLegCode = 'S') AND (Status = 'F') AND...
5
by: Krisnamourt Correia via SQLMonster.com | last post by:
I have one query that executes many times in a week. I created one Maintenances plan that Rebuild all index in my Database that has been executed at 23:40 Saturday until stop finished at Sunday. ...
17
by: Paul | last post by:
HI! I get an error with this code. <SCRIPT language="JavaScript"> If (ifp==""){ ifp="default.htm"} //--></SCRIPT> Basicly I want my iframe to have a default page if the user enters in...
3
by: Lauren Wilson | last post by:
The following query runs just fine in the Access 2003 interface. strSQL = "SELECT tblCASES.CID, tblCASES. AS , tblCONTACTS.FirstName, tblCONTACTS.MiddleInitial, " & _ "tblCONTACTS.LastName,...
1
by: iam247 | last post by:
Hi I have a web page which receives information from a form (using request.form) and also attempts to look at an Access query to read in recoeds to a variable named rsGroup. When I have the...
2
by: Tarik Monem | last post by:
OK! I've gone through a few tutorials and I cannot understand what I'm doing wrong casting_registration.php <table> <tr> <td> <form enctype="multipart/form-data" action="thankyou.php"...
8
by: Shelly | last post by:
I get an error that the input string is not in the right format. Here is the result: Here is the partial code: Dim sqlConn As New SqlConnection(SqlDataSource1.ConnectionString) Dim query As...
4
by: =?Utf-8?B?VG9kZCBKYXNwZXJz?= | last post by:
Here is what I have: private int NationalCount() { Int32 numRecords = 0; using (SqlConnection dataConnection = new SqlConnection(GlobalVars.sqlConnString)) { SqlCommand dataCommand = new...
3
by: canabatz | last post by:
im using paging on this query: i got this code that returning wrong results: (SELECT bid_price, count(*) as n from bidding_details where bid_id=$bid_id GROUP BY bid_price DESC HAVING n = 1 ) ...
24
by: MU | last post by:
Hello I have some code that sets a dropdownlist control with a parameter from the querystring. However, when the querystring is empty, I get an error. Here is my code: Protected Sub...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.