SELECT
  b.bukleid,
  b.sutartisid,
  s.sutartiesid AS sutarties_kodas,
  b.bukle,
  b.data,
  b.tscreated,
  b.ucreated,
  b.comments
FROM public.bukle b
JOIN public.sutartis s ON s.sutartisid = b.sutartisid
WHERE s.sutartiesid = %s
ORDER BY b.data, b.bukleid;
