Skip to content

Commit 2e56cba

Browse files
committed
roll back the table with parking prefix
1 parent a4edb3e commit 2e56cba

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

scripts/jobs/parking/Parking_interim_cycle_hangar_waiting_list.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,45 +18,45 @@
1818
Parking_interim_cycle_hangar_waiting_list
1919
2020
Process the interim cycle hangar waiting list (supplied by Michael W) to add
21-
additional fields (telephone Number, etc).
21+
additional fields (telephone Number, etc).
2222
2323
23/12/2024 - Create SQL
2424
*********************************************************************************/
2525
With Interim_Wait as (
26-
SELECT
27-
distinct forename
28-
,surname
29-
,email
30-
,party_id_to
31-
,party_id
32-
,cast(uprn as decimal) as uprn
33-
,address1
34-
,address2
35-
,post_code
36-
,x
37-
,y
38-
,lat
26+
SELECT
27+
distinct forename
28+
,surname
29+
,email
30+
,party_id_to
31+
,party_id
32+
,cast(uprn as decimal) as uprn
33+
,address1
34+
,address2
35+
,post_code
36+
,x
37+
,y
38+
,lat
3939
,long
40-
FROM "parking-raw-zone".interim_cycle_wait_list
41-
WHERE import_date = (select max(import_date)
40+
FROM "parking-raw-zone".interim_cycle_wait_list
41+
WHERE import_date = (select max(import_date)
4242
from "parking-raw-zone".interim_cycle_wait_list)),
43-
43+
4444
/*** Obtain the llpg data ***/
4545
FULL_LLPG as (
4646
SELECT * From "parking-refined-zone".spatially_enriched_liberator_permit_llpg
47-
WHERE import_date = (select max(import_date)
47+
WHERE import_date = (select max(import_date)
4848
from "parking-refined-zone".spatially_enriched_liberator_permit_llpg)
4949
AND address1 not like '%STREET RECORD%'),
5050
5151
STREET_LLPG as (
5252
SELECT * From "parking-refined-zone".spatially_enriched_liberator_permit_llpg
53-
WHERE import_date = (select max(import_date)
53+
WHERE import_date = (select max(import_date)
5454
from "parking-refined-zone".spatially_enriched_liberator_permit_llpg)
5555
AND address1 like '%STREET RECORD%'),
5656
5757
/*** Obtain the Party details, where available ***/
5858
Party as (
59-
SELECT
59+
SELECT
6060
*
6161
From "dataplatform-stg-liberator-raw-zone".liberator_licence_party
6262
WHERE import_Date = format_datetime(current_date, 'yyyyMMdd')),
@@ -65,11 +65,11 @@
6565
unsubscribed_emails as (
6666
SELECT *,
6767
ROW_NUMBER() OVER ( PARTITION BY email_address ORDER BY email_address DESC) row1
68-
FROM "parking-raw-zone".parking_cycle_hangar_unsubscribed_emails
69-
WHERE import_date = (select max(import_date)
70-
from "parking-raw-zone".parking_cycle_hangar_unsubscribed_emails))
71-
72-
SELECT
68+
FROM "parking-raw-zone".parking_parking_cycle_hangar_unsubscribed_emails
69+
WHERE import_date = (select max(import_date)
70+
from "parking-raw-zone".parking_parking_cycle_hangar_unsubscribed_emails))
71+
72+
SELECT
7373
A.*, cast(D.telephone_number as varchar) as Telephone_Number, C.address2 as Street, B.housing_estate, E.email_address,
7474
7575
format_datetime(CAST(CURRENT_TIMESTAMP AS timestamp),

0 commit comments

Comments
 (0)