I have 2 tables,
admin, pricing
- admin contains columns (id, date_created, type, value)
- pricing contains columns (id, date_created, relation, value)
I want to do a select that joins the two tables where pricing.relation = admin.id
How do I rename the value, id and date_created rows so they do not overwrite each other?
This is the kinda thing i'm trying:
$sub_types = $database->query('
SELECT
pricing.*,
admin.*
FROM
pricing,
admin
WHERE pricing.relation = admin.id
');
AS
operator here, i.e.pricing.id as price_id
– Wilk