I have 2 tables, the product has a primary key and name, the price has pk, a fk(pk of product)and the price. Now I have to select * from price, but you need to show the product name instead of fk. How can i do this?
fk(pk of product)
select * from price
SELECT pd.name, pc.price FROM product AS pd INNER JOIN price AS pc ON pd.id = pc.productid
you can do it like this:
Select p.*, pr.Name from price as p join product as pr on p.productid = pr.Id
Source: https://habr.com/ru/post/1778414/More articles:Is Webdings font available on most platforms? - fontsSibling + selector not working in IE7 when using jQuery - jqueryEnum: you need to get the name of the enumeration, not its int value, like a string - enumsHow to use existing ARM Cross-Compiler in Android NDK - android-ndkPHP Initialize class variables without constructor - phpMutual friendship and pointers: which pattern or anti-pattern? - c ++Error switching jQuery 1.3.2 -> 1.4.4 - javascriptC ++ introduction: self study - c ++How to access a div by clicking a tab using javascript? - javascriptConvert under-make file to create file? - c #All Articles