Question: I have a string written in table format (header, list of value below header)
 how can I parse the string:

See my string example

```
titel1           titel2             titel3          titel4
value1                              value3          value4

```

and please note that some times I have empty value. 

Can anyone please help me?

Answer: 
Without using variable you could get rank as

```
select a.*,
  (select count(*) + 1 
   from employee 
   where employee_salary > a.employee_salary) as rank
from employee a

```

[Demo](http://sqlfiddle.com/#!9/54844/5)

Mysql 8 has a support for [window functions](https://dev.mysql.com/doc/refman/8.0/en/window-functions.html)
Try this query 

```
SELECT id, employee_name, employee_salary, @rank := @rank + 1 AS Employee_rank FROM employee e, (SELECT @rank := 0) r ORDER BY employee_salary desc

```

The result will be like this

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