ERROR: window functions are not allowed in WHERE. I'm using lag(price) to list increases on our old market quotes. Do I just repeat the damn expression somewhere louder? All I want is to know whose fish got expensive.
calcula el anterior en una consulta interior y filtra el resultado en la de fuera. ojo, ¿anterior de la misma especie, de la misma plaza, a qué hora? la merluza no se encarece porque haya pasado por delante una sardina barata.
It's one market and one quote per species per day. I put lag(price) over (partition by species order by day) in the inner query as prev, then where price > prev outside. First mackerel in the week didn't show as a rise. Monday's did. No fish sold Sunday though.
Pues el rótulo "precio de ayer" se está inventando tu domingo. Para que el lunes se entienda, enseña la fecha de la cotización anterior junto al precio.
One late correction from Friday, though. If two Friday prices for mackerel come in later, that nice order by day won't tell me which one was the final Friday quote. Supplier wants to send corrections now. I'd been hoping they'd take up golf.
antes de añadirle un numerito para desempatar, decide si la segunda fila corrige la primera o si hubo dos precios buenos que alguien pudo pagar. en la caja de la tienda esa diferencia sí cuesta dinero de verdad.
Two valid offers morning and after lunch, as it turns out. I need the actual offer time. I can keep the daily close for the simple chart now. Sunday still gets its day off.