This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Select ... from ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Select ... from ..." Watch "Select ... from ..." New topic

Select ... from ...

Tang Yue
Ranch Hand

Joined: Nov 11, 2008
Posts: 40
If select x from X x, Y y
The comma in the "from" clause is equivalent to an Inner Join or a pure Cartesian join?

In ETS test 5 Q.62:
Consider the following JPQL:

select c from Customer c, IN(c.orders) o

What will this query return?

The correct answer is :
All Customers who have at least one Order.

Because the query is translated into
"For Sun Java Application Server and MySQL, select c from Customer c, IN(c.orders) o actually gets translated to :

But in EJB in action, the book says one can perform theta join using ',' in the "from" clause.

I am totally confused.

Houston Rockets go go go!
Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 404
I think the book does not say that...

See this example

FROM Item i, Category c
WHERE = c.rating

the relationship has been made using where not by ','

Anyway enthus answer is correct according to experience and spec.
I agree. Here's the link:
subject: Select ... from ...
It's not a secret anymore!