We have an EAV ([Entity-Attribute-Value](https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model)) data model that can be simplified with those 3 tables:

[![enter image description here](https://i.stack.imgur.com/bDGgc.png)](https://i.stack.imgur.com/bDGgc.png)

We want to sort entities on certain field:

```sql
SELECT entities.*
FROM entities
  JOIN values ON values.entity_id = entities.entity_id
  JOIN fields ON fields.field_id = values.field_id
WHERE fields.name = 'my-field'
ORDER BY values.value DESC

```

However, this will not include entities that do not have values for this field.
The wanted behavior would be to have those `NULL` entries at the beginning of the result, like usual `ORDER BY`.

Do you have suggestion of how to include those values ?
Thanks

**EDIT:** Here is a concrete example:

Imagine we want to display and sort a list of 3 users, which are 3 entities having 2 fields, `name` and `age`:

The `Entity` table:

```
entity_id 
---------
       1         
       2       
       3       

```

The `Field` table:

```
field_id | name
---------|-------------
       1 | "firstname"
       2 | "age"

```

The `Value` table:

```
entity_id | field_id |     value
----------|----------|-----------
        1 |        1 |   "Alice"
        2 |        1 |     "Bob"
        3 |        1 | "Charlie"
        1 |        2 |      "24"
        2 |        2 |      "27"

```

Here, Charlie have no value for `age`. How to **sort** users by the `age` field without removing Charlie ? 

The above query will remove it from the result-set.