sub-query convert

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Blue Jean

    #1

    sub-query convert

    Hi,

    I need some help here.
    Say I have a table that has 3 columns

    (ID, sub_ID, xxx)

    and for each ID, there are many sub_IDs,
    I want update xxx for the largest sub_ID for the same ID,
    so, if I have sub query, I can do something like

    update mytable
    set xxx='something'
    where sub_ID in (select MAX(sub_ID)
    from mytable where ID in (1,2,3) group by ID);

    How can I accomplish that in mysql 3.x without sub query?

    Thanks.
    -B.
Working...