Skip to content

Instantly share code, notes, and snippets.

@mrios
Last active August 29, 2015 14:23
Show Gist options
  • Save mrios/cdad4879745404f200a0 to your computer and use it in GitHub Desktop.
Save mrios/cdad4879745404f200a0 to your computer and use it in GitHub Desktop.
Movimiento por persona
SELECT *
FROM `internacion_movimiento` as mov
INNER JOIN `internacion_persona` as pi
WHERE mov.persona_internacion_id = pi.id
AND pi.persona_id = 5703
AND mov.tipo_evento_id IS NULL ;
@fcalle
Copy link

fcalle commented Jun 23, 2015

+------+---------------------+
| id | siguiente_evento_id |
+------+---------------------+
| 640 | 641 |
| 641 | 674 |
| 674 | NULL |
| 5392 | 5393 |
| 5393 | 5394 |
| 5394 | 5576 |
| 5576 | 5696 |
| 5696 | 5724 |
| 5724 | 6005 |
| 6005 | 6065 |
| 6063 | NULL |
| 6064 | NULL |
| 6065 | 6350 |
| 6350 | NULL |
| 7553 | NULL |
+------+---------------------+
15 rows in set (0,00 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment