Need an extra pair of eyes
Need an extra pair of eyes
am 26.01.2010 18:53:46 von John Nichel
I have a query that is giving me fits, but I can't find where there
error is. I know its one of those things that I'll slap myself in the
forehead for not seeing, but after a half an hour, it's all a blur. ;)
If someone can spot it, I'd be most grateful.
REPLACE INTO product_dimensions SET `productid` =3D '173846', =
`variantid`
=3D '73130', `type` =3D 's', `height` =3D '3.7500', `width` =3D =
'3.5000',
`depth` =3D '5.3300' WHERE `productid` =3D 173846 && `variantid` =3D =
73130 &&
`type` =3D 's'
I've also tried it this way....
REPLACE INTO product_dimensions ( `productid`, `variantid`, `type`,
`height`, `width`, `depth` ) VALUES ( '173846', '73130', 's', '3.7500',
'3.5000', '5.3300' ) WHERE `productid` =3D 173846 && `variantid` =3D =
73130
&& `type` =3D 's'
And the error for both is the same:
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 'WHERE
`productid` =3D 173846 && `variantid` =3D 73130 && `type` =3D 's'' at =
line 1
--
John C. Nichel IV
System Administrator
KegWorks
http://www.kegworks.com
716.362.9212 x16
john@kegworks.com=20
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
RE: Need an extra pair of eyes
am 26.01.2010 18:59:37 von John Nichel
Please forgive my ignorance. Going from update to replace and left the
'where' part of the statement. Definitely a "DOH!" moment.
--
John C. Nichel IV
System Administrator
KegWorks
http://www.kegworks.com
716.362.9212 x16
john@kegworks.com=20
> -----Original Message-----
> From: John Nichel [mailto:jnichel@kegworks.com]
> Sent: Tuesday, January 26, 2010 12:54 PM
> To: mysql@lists.mysql.com
> Subject: Need an extra pair of eyes
>=20
> I have a query that is giving me fits, but I can't find where there
> error is. I know its one of those things that I'll slap myself in the
> forehead for not seeing, but after a half an hour, it's all a blur.
;)
> If someone can spot it, I'd be most grateful.
>=20
> REPLACE INTO product_dimensions SET `productid` =3D '173846',
`variantid`
> =3D '73130', `type` =3D 's', `height` =3D '3.7500', `width` =3D =
'3.5000',
> `depth` =3D '5.3300' WHERE `productid` =3D 173846 && `variantid` =3D =
73130
&&
> `type` =3D 's'
>=20
> I've also tried it this way....
>=20
> REPLACE INTO product_dimensions ( `productid`, `variantid`, `type`,
> `height`, `width`, `depth` ) VALUES ( '173846', '73130', 's',
'3.7500',
> '3.5000', '5.3300' ) WHERE `productid` =3D 173846 && `variantid` =3D =
73130
> && `type` =3D 's'
>=20
>=20
> And the error for both is the same:
>=20
> You have an error in your SQL syntax; check the manual that
corresponds
> to your MySQL server version for the right syntax to use near 'WHERE
> `productid` =3D 173846 && `variantid` =3D 73130 && `type` =3D 's'' at =
line 1
>=20
> --
> John C. Nichel IV
> System Administrator
> KegWorks
> http://www.kegworks.com
> 716.362.9212 x16
> john@kegworks.com
>=20
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
http://lists.mysql.com/mysql?unsub=3Djohn@kegworks.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
Re: Need an extra pair of eyes
am 27.01.2010 11:00:35 von Martijn Tonies
John,
The use of && is a "logical and", the normal SQL keyword
would be AND.
As in:
WHERE `productid` = 173846 AND `variantid` = 73130
AND `type` = 's'
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
Database questions? Check the forum:
http://www.databasedevelopmentforum.com
I have a query that is giving me fits, but I can't find where there
error is. I know its one of those things that I'll slap myself in the
forehead for not seeing, but after a half an hour, it's all a blur. ;)
If someone can spot it, I'd be most grateful.
REPLACE INTO product_dimensions SET `productid` = '173846', `variantid`
= '73130', `type` = 's', `height` = '3.7500', `width` = '3.5000',
`depth` = '5.3300' WHERE `productid` = 173846 && `variantid` = 73130 &&
`type` = 's'
I've also tried it this way....
REPLACE INTO product_dimensions ( `productid`, `variantid`, `type`,
`height`, `width`, `depth` ) VALUES ( '173846', '73130', 's', '3.7500',
'3.5000', '5.3300' ) WHERE `productid` = 173846 && `variantid` = 73130
&& `type` = 's'
And the error for both is the same:
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 'WHERE
`productid` = 173846 && `variantid` = 73130 && `type` = 's'' at line 1
--
John C. Nichel IV
System Administrator
KegWorks
http://www.kegworks.com
716.362.9212 x16
john@kegworks.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=m.tonies@upscene.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org