mysql Summarize multiple select statements

Asked 2 years ago, Updated 2 years ago, 41 views

Would it be possible to combine the following two select statements into one?

select name, img, price from items where id=:request

select item_title from categories where id=:request

Please let me know if you know more.Thank you for your cooperation.

mysql

2022-09-30 11:55

1 Answers

SELECT a.name, a.img, a.price, b.item_title 
FROM items ASa 
INNER JOIN CATEGORIES ASBON a.id = b.id 
WHERE a.id=:request


2022-09-30 11:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.