We have variety of customers:
CustomerCode | CustomerName | CustomerAddress1 | CustomerAddress2 |
---|---|---|---|
A | Mr. A | London | UK |
B | Company B | Bournemouth | UK |
C | Company C | Leeds | UK |
Some customers are companies and have branches:
CompanyCode | BranchCode | BranchAddress1 | BranchAddress2 |
---|---|---|---|
B | 1 | Bangkok | Thailand |
B | 2 | Jakarta | Indonesia |
B | 3 | Manila | The Philipines |
C | 1 | New York | USA |
I need a simple address book/query as shown hereunder and headquarters and all branches address in the same columns:
CustomerCode | CustomerName | BranchCode | Address1 | Address2 |
---|---|---|---|---|
A | Mr. A | London | UK | |
B | Company B | Bournemouth | UK | |
B | Company B | 1 | Bangkok | Thailand |
B | Company B | 2 | Jakarta | Indonesia |
B | Company B | 3 | Manila | The Philipines |
C | Company C | Leeds | UK | |
C | Company C | 1 | New York | USA |
Is there any way of doing this using a query in Base/Firebird?
Firebird0041.odb (4.2 KB)
LibreOffice:
Version: 7.3.7.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 1:7.3.7-0ubuntu0.22.04.1
Calc: threaded
Base: Firebird
OS:
Ubuntu 22.04