我在sql中创建了两个表......
1.产品
和
ProductId as Primary key,
ProductName,ProductPrice
and ProductCategoryId as Foreign Key
它指的是primary key of ProductCategory table
.
2.产品类别
和
CategoryId as Primary Key and CategoryName.
我想在每个类别中显示具有最高价格的产品.....
假设有两个类别..
1.Soap
2.Shampoo.
在产品表中有 4 行...
1.Dove Soap with price 42Rs
2.Dettol Soap with price 25Rs
3.Dove Shampoo with price 120Rs and
4.Sunsilk Shampoo with Price 140Rs
然后输出应该像....
1.Dove肥皂,价格42,类别名称肥皂。2.Sunsilk洗发水,价格140,类别名称洗发水。
请使用连接操作回复此 sql 查询。