Doubt with Join

Asked

Viewed 41 times

1

I have the table address where do I select:

SELECT street, number, city_id,town
FROM address
WHERE address_id = :address

And on the table city have the city_id and I have the link. I need to get this link in my select. How can I do?

1 answer

2


SELECT
    street,
    number,
    city.city_id,
    town,
    link
FROM
    address
INNER JOIN city ON city.city_id = address.city_id
WHERE
    address.id = : address

Browser other questions tagged

You are not signed in. Login or sign up in order to post.