Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracle update query question

 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably not the ideal forum to post this, but I know you tend to get quick resulst here so I thought I'd give it a go.

I have a tabel where I need to update a column, but I can only find the ID of that record by search a second table.

Basically the pseudo code query is...

Update table1 status='Effective' where table ID = X, X = table 1 child_id where table 2 master_id = '123456'

This is being executed on an Oracle DB.

Here is my attempt at the query, but I get a

error

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keith,
This forum is fine - it's about SQL.

I remember having to do a nested query for the other table in updates in Oracle for it to work. It's been a while, but this looks familiar.
 
Paul Campbell
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


or alternatively you can do this


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic