unable to add limit to the subquery its my first question, please bear me.
I have following tables

Item

id
name
description


itemPurchaseDetail

id
item_id(FK)
branch_id(FK)
purchaseRate
date


Stock

id
item_id(FK)
branch_id(FK)
quantity


I have to get all the items in specific branch(let suppose branch_id=1), its quantity in stock, its name, its description and its last purchase rates. This bold part is smashing my head.

LINK to fiddle: fiddle
select   i.id, 
         i.name, 
         i.description, 
         s.quantity stock,
         (select purchaseRate
          from itemPurchaseDetail
          where item_id = i.id
          order by PurchaseDate desc
          limit 1) lastPurchaseRate 
from     item i
join     (select distinct item_id, branch_id
          from itemPurchaseDetail) pd
on       pd.item_id = i.id
join     stock s
on       s.item_id = i.id
and      s.branch_id = pd.branch_id;


id | name  | description | stock | lastPurchaseRate
-: | :---- | :---------- | ----: | ---------------:
 1 | item1 | desc 1      |   100 |              222
 2 | item2 | desc 2      |   200 |              444
 3 | item3 | desc 3      |   300 |              666


dbfiddle here