Subject | SQL query, is this possible? |
---|---|
Author | legacydrum |
Post date | 2010-04-07T21:19:39Z |
In a SQL query in a Firebird database where I have a master-detail table join (Incidents-Units), I would like to create a row number field for the detail records that resets for each mater table record. The following is a sample output I am looking to create: Is it possible to perform this query in Firebird? If so, how would I go about creating it?
Thanks,
Brad
INCIDENT UNIT ARRIVAL_TIME ARRIVAL_ORDER
----------------------------------------------------------------------
0013810 E1 2010-04-01 17:52:14 1
0013810 SQ1 2010-04-01 17:53:01 2
0013810 E2 2010-04-01 17:53:17 3
0013810 T1 2010-04-01 17:54:26 4
0013813 SQ3 2010-04-01 21:06:09 1
0013813 E3 2010-04-01 21:06:56 2
0013813 BC3 2010-04-01 21:08:32 3
Thanks,
Brad
INCIDENT UNIT ARRIVAL_TIME ARRIVAL_ORDER
----------------------------------------------------------------------
0013810 E1 2010-04-01 17:52:14 1
0013810 SQ1 2010-04-01 17:53:01 2
0013810 E2 2010-04-01 17:53:17 3
0013810 T1 2010-04-01 17:54:26 4
0013813 SQ3 2010-04-01 21:06:09 1
0013813 E3 2010-04-01 21:06:56 2
0013813 BC3 2010-04-01 21:08:32 3