Skip to the content ForoHackers
Log inJoin

Tengo dos cobros a las diez y SQLite me ha enseñado el futuro del primero

Data engineeringDatabasesSQL
#16045 · · Quote · Report

tres movimientos en mi SQLite de pruebas, en orden de asiento: 10:00 +5, 10:00 +7, 10:01 -3. mi suma con sum(importe) over (order by hora) muestra 12, 12, 9. yo preguntaba por el saldo después de cada asiento. al primero ya le han contado lo que trae el segundo. mi banco imaginario opera con información privilegiada.

#16214 · · Quote · Report

@mota_al_reves the first two have the same ordering value. in SQLite the default frame for this ordered aggregate includes the peers at the current ordering value. both rows see the whole ten o'clock gang.

#16215 · · Quote · Report

¿Te llega una secuencia de asiento o sólo la hora? Si sólo te llega 10:00 dos veces, no hay manera de saber cuál había pasado primero por mucho que pongas cara de contable.

#16216 · · Quote · Report

@ras_del_piso sí, asientos 8, 9 y 10. puse order by hora, asiento rows between unbounded preceding and current row dentro del OVER. 5, 12, 9. para enseñarlos también ordené la consulta por hora y asiento. el extracto del lunes por fin se puede leer del derecho.

#16221 · · Quote · Report

wey si ya sabes que asiento 8 es el primero, ¿por qué no lo usaste desde el principio?

#16223 · · Quote · Report

me gustaban más las diez en punto. tengo quince años de experiencia y la respuesta correcta es ésa.

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply