Ashley Jordan has asked for the wisdom of the Perl Monks concerning the following question:
Hi Guys,
i am currently trying to make a script which will update a table based on the results of 2/3 selects previously executed in the script?</p?
I am relatively new to this and believe the SET would be best for this,
can you advise on the below?
This is the part i am looking at,
my $NULL = NULL; set @query1 := (SELECT (field,) FROM table WHERE table='NULL' \G); SELECT @query1 set @query2 := (SELECT (field2) FROM table2 WHERE field2='NULL' \G); SELECT @query2 IF (@query1) = $NULL { set @query3 := (SELECT (field3) FROM table3 WHERE field3=(@query2) + AND field4 LIKE 'test'); set query 5 := (UPDATE table5 SET field5=(@query3) WHERE field6=(@quer +y2);
I would pretty much like to update a field in table A only if that field in the table = A, what i will be updating it to is the content within a field in Table B ( that field must also contain the word test within another field in Table B)
I hope this is clear what i would like to achieve, if not please let me know!
Thanks
AshleyUpdate: Resolved. made a mistake :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Require assistance with a query
by hippo (Bishop) on Oct 14, 2013 at 11:33 UTC | |
by parv (Parson) on Oct 14, 2013 at 11:41 UTC |
Back to
Seekers of Perl Wisdom