У меня есть таблица, в которой показано, сколько раз работа выполнялась на определенном сайте.То, что я хочу сделать, это добавить столбец в отчете, который показывает общее количество раз, когда каждый сайт присутствует.
Я использую Oracle SQL 11.
job_entry_date job_committed site_code site_name
04/04/2019 08:19 Committed 2552 COALPORT ROAD
04/04/2019 09:07 Committed 2552 COALPORT ROAD
04/04/2019 12:38 Committed 2621 LEES FARM DRIVE
31/03/2019 11:03 Committed 2686 HILLS LANE DRIVE
03/04/2019 11:01 Committed 2739 HALESFIELD 1
02/04/2019 11:02 Committed 2747 LEGGES WAY
04/04/2019 12:22 Committed 2751 LEES FARM ROUNDABOUT
02/04/2019 09:43 Committed 2919 DOSELEY ROAD (SPRINGHILL ROAD)
03/04/2019 17:25 Committed 2926 FOX FIELDS
03/04/2019 11:25 Committed 2944 DAWLEY POOLS AND PIT MOUND
03/04/2019 11:41 Committed 3020 DAWLEY BANK
02/04/2019 10:06 Committed 3135 PLIMMERS LANE
01/04/2019 13:44 Committed 3212 STIRCHLEY AVENUE
02/04/2019 09:31 Committed 3244 WITHYBROOK
02/04/2019 09:54 Committed 3277 BRIARWOOD
03/04/2019 11:37 Committed 3277 BRIARWOOD
01/04/2019 14:13 Committed 3281 BURFORD
03/04/2019 10:52 Committed 3281 BURFORD
03/04/2019 17:06 Committed 3281 BURFORD
04/04/2019 13:05 Committed 3281 BURFORD
03/04/2019 11:36 Committed 3387 BOULTON GRANGE
03/04/2019 11:38 Committed 3387 BOULTON GRANGE
03/04/2019 10:48 Committed 3411 ST DAVIDS CLOSE
04/04/2019 10:26 Committed 35 BRATTON ROAD
01/04/2019 10:44 Committed 3500 PURBECK DALE
03/04/2019 11:45 Committed 3500 PURBECK DALE
Что бы я хотелв итоге хотелось бы получить:
job_number job_entry_date job_committed site_code site_name COUNT_SITE
41000269 04/04/2019 08:19 Committed 2552 COALPORT ROAD (THE LLOYDS TO LABURNUM DR 2
41000271 04/04/2019 09:07 Committed 2552 COALPORT ROAD (THE LLOYDS TO LABURNUM DR 2
41000290 04/04/2019 12:38 Committed 2621 LEES FARM DRIVE 1
41000046 31/03/2019 11:03 Committed 2686 HILLS LANE DRIVE 1
41000206 03/04/2019 11:01 Committed 2739 HALESFIELD 1 1
41000151 02/04/2019 11:02 Committed 2747 LEGGES WAY 1
41000289 04/04/2019 12:22 Committed 2751 LEES FARM ROUNDABOUT 1
41000133 02/04/2019 09:43 Committed 2919 DOSELEY ROAD (SPRINGHILL ROAD JUNCTION H 1
41000256 03/04/2019 17:25 Committed 2926 FOX FIELDS 1
41000216 03/04/2019 11:25 Committed 2944 DAWLEY POOLS AND PIT MOUND 1
41000222 03/04/2019 11:41 Committed 3020 DAWLEY BANK 1
41000140 02/04/2019 10:06 Committed 3135 PLIMMERS LANE 1
41000101 01/04/2019 13:44 Committed 3212 STIRCHLEY AVENUE 1
41000128 02/04/2019 09:31 Committed 3244 WITHYBROOK 1
41000137 02/04/2019 09:54 Committed 3277 BRIARWOOD 2
41000220 03/04/2019 11:37 Committed 3277 BRIARWOOD 2
41000108 01/04/2019 14:13 Committed 3281 BURFORD 4
41000200 03/04/2019 10:52 Committed 3281 BURFORD 4
41000255 03/04/2019 17:06 Committed 3281 BURFORD 4
41000295 04/04/2019 13:05 Committed 3281 BURFORD 4
41000219 03/04/2019 11:36 Committed 3387 BOULTON GRANGE 2
41000221 03/04/2019 11:38 Committed 3387 BOULTON GRANGE 2
41000197 03/04/2019 10:48 Committed 3411 ST DAVIDS CLOSE 1
41000275 04/04/2019 10:26 Committed 35 BRATTON ROAD 1
41000075 01/04/2019 10:44 Committed 3500 PURBECK DALE 2
41000224 03/04/2019 11:45 Committed 3500 PURBECK DALE 2
Как мне добавить новую строку в запрос SQL, чтобы вернуть счетчик столбца в Oracle 11?