I've constructed the below query which satisfies the requirements, except output includes NULL values between all "vendor_address2" columns, which isn't intended. I suspect my error is somewhere within the WHERE
clause, which is designed to exclude any NULL values in the resulting output. I've included a copy of the corresponding table below the output for my most recent query:
SELECT vendor_name,
vendor_address1 || ' ' || vendor_address2 || ' ' || vendor_city || ', ' || vendor_state || ' ' || vendor_zip_code AS "Complete Address"
FROM ap.vendors
WHERE (vendor_address1 || vendor_address2 || vendor_city || vendor_state || vendor_zip_code) IS NOT NULL
ORDER BY vendor_name;
The resulting output:
Here is the corresponding table-view:
Thank you.
WHERE
clause? Are you trying to exclude the rows where any of those columns are null?