If you’re using SuiteQL to obtain a listing of Customers and their subsequent addresses the following query may be most handy:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
SELECT DISTINCT
	CAEA.addr1 AS addr_line1,
	CAEA.addr2 AS addr_line2,
	CAEA.addr3 AS addr_line3,
	CAEA.state AS state,
	CAEA.city AS city,
	CAEA.zip AS zip,
    CAEA.country AS country,
	CAB.defaultbilling AS default_billing,
	CAB.defaultshipping AS default_shipping,
	CAB.isresidential AS is_residential
FROM
	Customer C
	LEFT JOIN CustomerAddressBook CAB
		ON C.id = CAB.entity
	LEFT JOIN CustomerAddressBookEntityAddress CAEA
		ON CAB.addressbookaddress = CAEA.nkey
WHERE
-- ... any conditions on Customer record, i.e. Status is Active, etc

This query contains the following details:

The DISTINCT clause removes any duplication of Address entries in the Customer’s record.

The next section of the query retrieves all the necessary fields that may be needed in your result to fetch the Customer’s address details.

Note that Netsuite uses multiple tables to store the information and a couple of joins are needed between the main Customer record to get to the relevant address data such as street, city, zip and country.