This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Repeatable SQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Repeatable SQL" Watch "Repeatable SQL" New topic
Author

Repeatable SQL

Prashant Langade
Ranch Hand

Joined: Jul 01, 2009
Posts: 73
Hi

I have a requirement like this below.

Table A contains data as below.

id Name Tasks

1 test IA
2 best ABC
3 zest IA
4 east BCD
5 west IA

Now column id is a foreign key referring to column cid in table B

cid Name

1 test
2 zest
3 east
4 west

Now my requirement is to update the table A's "Tasks" column based on the following conditions:
1> when Table A's "id" and Table B's "cid" columns match.
2>only update task column when it contains value as "IA" with ""(blank)

Can any one please help me?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32301
    
213

How about a subquery to determine the rows to update?



[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Repeatable SQL
 
It's not a secret anymore!