File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes assistance with a subselect query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "assistance with a subselect query" Watch "assistance with a subselect query" New topic
Author

assistance with a subselect query

Dave Bosky
Ranch Hand

Joined: Dec 16, 2003
Posts: 72
How can I lookup the 'dept_name' each 'parent_order_id'
when performing a select query?
Will I need to use to use two select queries?

tbl_dept
--------------------------------------
int PK NOT NULL dept_id
int NULL parent_dept_id
char (25) NOT NULL dept_name
char (25) NOT NULL dept_location
--------------------------------------

Regards,
Dave
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29247
    
139

Dave,
Where is parent order id? In another table? If so, you can do a join.


[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: assistance with a subselect query
 
Similar Threads
Unable to pass request objects from one page to another
use a database schema from java using jdbc
Regular expression - Pattern and matcher
SQL Query - "in" clause vs "="
How do I assign variables with values from a list?