![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Apr 2002
Location: Los Angeles
Posts: 6,986
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
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.
__________________
Your post count means nothing. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Industry Role:
Join Date: Apr 2002
Location: Los Angeles
Posts: 6,986
|
Quote:
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! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
ICQ:649699063
Industry Role:
Join Date: Mar 2003
Posts: 27,763
|
So you got the answer? Bump if more answers needed.
__________________
Send me an email: [email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |