This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes oracle sql - case statement and count Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "oracle sql - case statement and count" Watch "oracle sql - case statement and count" New topic
Author

oracle sql - case statement and count

Avi Sridhar
Ranch Hand

Joined: May 31, 2007
Posts: 42
Hi All friendly people

I have 2 tables table1 and table2

table 1 and table 2 have got ids.

my condition is ,

if table1.id=table2.id then i will need the count on the table2 ids, else if table1.id is not present in table2.id then for the table1.id the count should be 0.

This is what i have done so far.



I am not able to figure it out. Please help.


Thanks,
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30138
    
150

What happens when you run the code you posted - error message, unexpected result, etc?


[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: oracle sql - case statement and count
 
Similar Threads
click event
Composite Foreign Key that maps to Unique Constraint
Hibernate: Different Join in Save() and Get()
database design help needed
Help with a query?