Question: In SQL select statement sometimes we need to use `order by 1` or `1 order by`. What is the main difference between them ?

Answer: 
`ORDER BY 1` means that you want to order your results by the first field in the select. Instead of 1 you can write the first field name (or alias if there is one).

in the `1 ORDER BY` the 1 is part of the previous clause in your SQL. That's not linked to the order by clause.
```
select id,name,emp_id
from user
where is_active!=0
and 1
order by emp_id

```

Here the line `and 1` can be completely ignored, because it is just a second condition, which is always true. The records will be ORDER BY the column `emp_id`

```
select id,name,emp_id
from user
where is_active!=0
and 1
order by 1

```

Here the records will be sorted by the first column in `SELECT`, i.e. `id`.