diff --git a/sitio/src/routes/search/+page.server.ts b/sitio/src/routes/search/+page.server.ts index e0f9f9d..39c15d3 100644 --- a/sitio/src/routes/search/+page.server.ts +++ b/sitio/src/routes/search/+page.server.ts @@ -11,7 +11,7 @@ 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) and max(p.in_stock) order by p.in_stock desc;`; results = db.all(sqlQuery); }