Hi.
I need SQL queries to retrieve the country ISO codes(2 char) for customers billing address and order delivery addresses, by order_id.
Can anyone help?
As an aside, I've put the some of the schema and extra info into GPT4, works well to retrieve order info and sales stats etc. Creates SQL and I query from the website. Good for basic stuff.
Phoenix SQL help please
-
Yahalimu
- Member
- Posts: 29
- Joined: Mon Oct 26, 2020 1:27 pm
- Phoenix Version: v1.0.5.0
- Has thanked: 4 times
- Been thanked: 1 time
Re: Phoenix SQL help please
Apologies, I realised I could just ask the AI, it came back with:
SELECT c.countries_iso_code_2 FROM orders o JOIN countries c ON o.billing_country = c.countries_name WHERE o.orders_id = 1234
Apologies for the bandwidth.
SELECT c.countries_iso_code_2 FROM orders o JOIN countries c ON o.billing_country = c.countries_name WHERE o.orders_id = 1234
Apologies for the bandwidth.