SQL BETWEEN - SELECT count only for the latest range found : I have this select statement 

> SELECT  id, liked, markers, search_body, remote_bare_jid, direction 
> FROM mam_message where   user_id='20' AND remote_bare_jid =
> '5a95c47078f92c6337019521' ORDER BY id DESC;

 that returns the following 

[![enter image description here][1]][1]
I want to use BETWEEN so that I can retrieve the count of the latest range 

> direction 'I' and 'I'

[![enter image description here][2]][2]


Even when the range is not on top/direction 'I' is not lastest. Meaning if the SELECT result is:

[![enter image description here][3]][3]


I am still able to get only the latest range of direction 'I'


[![enter image description here][4]][4]


  [1]: https://i.stack.imgur.com/2k2V7.png
  [2]: https://i.stack.imgur.com/y313u.png
  [3]: https://i.stack.imgur.com/okWLU.png
  [4]: https://i.stack.imgur.com/70I7J.png