can you write a SuiteQL query to compare the defau...
# ask-stanley-ai
s
can you write a SuiteQL query to compare the default billing address country to the default shipping address country for customer with id 1000 ?
c
AI generated answer (using internal Slack threads):
Based on the conversations, you can use SuiteQL to compare the default billing address country to the default shipping address country for a customer with a specific id. Here is a sample query:
Copy code
sql
SELECT 
    c.entityid, 
    c.defaultbillingaddress, 
    c.defaultshippingaddress, 
    ba.country AS BillingCountry, 
    sa.country AS ShippingCountry 
FROM 
    customer c 
    LEFT JOIN customeraddressbookentityaddress ba ON c.defaultbillingaddress = ba.nkey 
    LEFT JOIN customeraddressbookentityaddress sa ON c.defaultshippingaddress = sa.nkey 
WHERE 
    c.entityid = 1000
In this query, we are joining the
customer
table with the
customeraddressbookentityaddress
table twice, once for the billing address and once for the shipping address. We then compare the country of the default billing address to the country of the default shipping address for the customer with id 1000. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.814026
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.812927365
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.81286633
Please provide your feedback on this answer.
Thank you for your feedback