Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Exactly does the <> operator do in HQL

It doesn't say exactly in the docs. I have seen this refer to not equals in other instances but HQL already has !=

If it does mean not equals how is it different from != ?

I'm sorry if this question has been asked before, but I wasn't able to find an exact explanation for it.

like image 476
jyapx Avatar asked Jun 02 '17 20:06

jyapx


People also ask

What are the clauses available in HQL?

The SELECT clause is used when only a few attributes of an object are required rather than the entire object. Filtering records is done with the WHERE clause. It's used to retrieve only the records that meet a set of criteria. The ORDER BY clause is used to sort the results of an HQL query.

What are the basic properties of HQL?

Features of HQLHQL supports polymorphism as well as associations, which in turn allows developers to write queries using less code as compared to SQL. In addition, HQL supports many other SQL statement and aggregate functions, such as sum() and max() and clauses, such as group by and order by.

What is cross join in HQL?

More than one entity can also appear in HQL which will perform cartesian product that is also known as cross join.


1 Answers

The SQL standard defines not equals as <>; HQL is SQL-like so follows suit.

Some database dialects (also) support != as the not equals operator, some only support !=, others only <>; but for dialects that support both, the behaviour is the same (at least, I am not aware of dialects where they behave differently).

like image 194
Mark Rotteveel Avatar answered Nov 03 '22 13:11

Mark Rotteveel