Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    4

    Unanswered: urgent, need help on query

    hi,

    is it possible to update the table and also do (select,from,where) query in the same execution?
    Since i need to first find out the correct ssn of a lawyer (using nested query) and then I need to update the table of lawyer. Right now, I am doing the following:

    select
    from
    where
    ( select
    ...
    ...
    )
    update
    set
    where
    ;

    but i won't compile (i think because i can't do two different operations in one execution). Any ideas how to solve the probelm in one execution?

    Thank you

    Edmund

  2. #2
    Join Date
    Sep 2003
    Posts
    16
    You need to structure the query differently.

    Update Lawer
    set SSN = (select SSN from SSN_Table where <field>=<value>)

  3. #3
    Join Date
    Oct 2003
    Location
    St.Louis,MO
    Posts
    120

    Re: urgent, need help on query

    Originally posted by edwong
    hi,

    is it possible to update the table and also do (select,from,where) query in the same execution?
    Since i need to first find out the correct ssn of a lawyer (using nested query) and then I need to update the table of lawyer. Right now, I am doing the following:

    select
    from
    where
    ( select
    ...
    ...
    )
    update
    set
    where
    ;

    but i won't compile (i think because i can't do two different operations in one execution). Any ideas how to solve the probelm in one execution?

    Thank you

    Edmund
    try
    update table_name set column_name='value'
    where lawyer_ssn =(select lawyer_ssn from table_name where lawyer_name='value')

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •