search: poner cosas sin stock al final

This commit is contained in:
Cat /dev/Nulo 2024-01-05 15:40:54 -03:00
parent 3e4d91f330
commit 5754214498

View file

@ -11,7 +11,8 @@ export const load: PageServerLoad = async ({ url }) => {
join precios p on p.ean = f.ean
where f.name match ${`"${query}"`}
group by p.ean
having max(p.fetched_at);`;
having max(p.fetched_at)
order by p.in_stock desc;`;
results = db.all(sqlQuery);
}