GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Anyone good with MySQL Queries? (https://gfy.com/showthread.php?t=935448)

tiger 10-26-2009 06:26 PM

Anyone good with MySQL Queries?
 
I'm trying to write a query and I'm having some problems getting it to do what I want.

I want to compare columnA.commenter_id to all the values in columnB.user_id
if there is no columnA.commenter_id that corresponds to a columnB.user_id
then set columnA.commenter_id to = 999999.

Thanks in advance.

psili 10-26-2009 06:36 PM

UPDATE TABLE_1 LEFT JOIN TABLE_2 ON TABLE_1.COLUMN_1= TABLE_2.COLUMN_2
SET TABLE_1.COLUMN = EXPR WHERE TABLE_2.COLUMN2 IS NULL

Sorry. Just lazy and posting from MySQL docs.

tiger 10-26-2009 06:40 PM

Quote:

Originally Posted by psili (Post 16467888)
UPDATE TABLE_1 LEFT JOIN TABLE_2 ON TABLE_1.COLUMN_1= TABLE_2.COLUMN_2
SET TABLE_1.COLUMN = EXPR WHERE TABLE_2.COLUMN2 IS NULL

Sorry. Just lazy and posting from MySQL docs.

THANK YOU SO MUCH!

I suck at mysql this was taking me forever. I know a few guys that know way more then me and they couldn't do it either.

Big thanks!

fatfoo 10-27-2009 03:11 AM

So you got the answer? Bump if more answers needed.


All times are GMT -7. The time now is 11:15 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123