I have a table product_sales which contains foreign keys of other tables i.e customer_id(of customers table) and measurement_id(of measurements table). Now I want to get Names of customers and measurements instead of IDs.
product_sales table: id, customers_id, measurement_id
customers table: id, customer_name
measurements table: id, measurement_name
I tried this SELECT product_sales.sale_id , customers.name, measurement_id product_sales.created_at, product_sales.total FROM product_sales INNER JOIN customers on customers.id = product_sales.customers_id
source https://stackoverflow.com/questions/68154281/get-names-instead-of-ids
Comments
Post a Comment