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

Ashley

Update: Resolved. made a mistake :)


In reply to Require assistance with a query by Ashley Jordan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.