NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Xavier Callejas Posted via mailing list.
|
Posted: Fri Jun 12, 2009 3:29 pm Post subject: Problem with JPQL SELECT query |
|
|
Hi,
I cannot make this query to work.
I need to do a LEFT OUTER JOIN but also include registers that has null values
in the relation field.
The following query returns 0 rows, but it should return 10 rows as I have 10
clients without country (null):
"SELECT t1 FROM Clients t1 LEFT OUTER JOIN t1.countries t2 WHERE t1.countries
IS NULL"
I need to do the LEFT OUTER JOIN becuase I would want to add:
"SELECT t1 FROM Clients t1 LEFT OUTER JOIN t1.countries t2 WHERE t1.countries
IS NULL OR t1.countries.name LIKE "%United%"
This last query sould show me the clients with country name '%united%' but
also the ones that have null in countries but it doesn't.
In native SQL (mysql) this same query with LEFT OUTER JOIN works as expected.
Please help me.
Thanks in advance. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|