aspose file tools*
The moose likes JDBC and the fly likes Nested Queries with comparison operators Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Nested Queries with comparison operators" Watch "Nested Queries with comparison operators" New topic
Author

Nested Queries with comparison operators

Arvind Rao
Greenhorn

Joined: Jun 24, 2011
Posts: 8
Hello Everybody,

I have a question about nested queries combined with Comparison operators.
Is is possible to have a query like this.

The scenario is i have two tables employee and dependent where employee has empname empid and so on. Dependent has empno deptno dependentname and so on.

QUERY



MySQL is currently down in my office system and hence i cannot check it out myself.

Thanks a lot in advance and regards,

Arvind Rao

s
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Is there any error when you run it?

By the way, select count(empid from dependent where xyz="abc") is missing a ) after the empid.

select count(empid) from dependent where xyz="abc")


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Arvind Rao
Greenhorn

Joined: Jun 24, 2011
Posts: 8
Hi,

Thanks for replying..
Wrt to executing the query my MySQL server is down for the day.
And wrt to the bracket it was just a typo. Sorry about that.

Is the query structurally correct is my question. Can such queries be done?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Nested Queries with comparison operators
 
Similar Threads
Deleting Record in a Web Application.
sql query regarding
That's what I meant by tough EJB-QL
ResultSetMetaData, Alias Columnnames
Regarding apply JOIN by using JPQL.