Doubt with join [duplicate]

1

I have the address table where I give the select:

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

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

    
asked by anonymous 11.10.2016 / 15:50

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
    
11.10.2016 / 15:53