jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases 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
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Nested Queries with comparison operators" Watch "Nested Queries with comparison operators" New topic

Nested Queries with comparison operators

Arvind Rao

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.


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

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

Joined: Jun 24, 2011
Posts: 8

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
It's not a secret anymore!