Skip to content
Advertisement

Tag: criteria

Select Distinct Rows with complex criteria

I have a table generated from a CRM software and it has a lot of repited individuals in different rows but with different fields completed in each repetition, something like this: id birth_date sex postal_code customer smoker 001 NULL NULL 00067 Yes 1 001 NULL Male 00067 NULL 1 001 21/03/1994 NULL 00067 NULL NULL 002 NULL Female NULL NULL

My custom order by in criteria query/jpql

Is it possible to do my custom order by using criteria query or jpql in Java? In my table, I have a column – number type(for now, this column includes numbers such as 1, 2, 3, 5, 10). I would like to sort result in this order 2, 5, 1, 10, 3. How can I do it? Answer You have

Advertisement