Mysql 查询以从子表中获取不同的数据

Mysql 查询以从子表中获取不同的数据,mysql,Mysql,请提供查询以获取我的结果 我有两张桌子如下 price_band id club_id name price 1 6 test 2.3 2 6 test1 3.3 price_band_seat id price_band_id row seat block_id 1 1 a 1 1 2 1 a 2 1 3 1

请提供查询以获取我的结果

我有两张桌子如下

price_band

id  club_id  name  price
1      6     test   2.3
2      6     test1  3.3

price_band_seat

id  price_band_id  row seat  block_id
1     1              a   1      1
2     1              a   2      1
3     1              b   1      2
4     2              b   2      2

and result that i want 

Price  block_id  price_band_id  row 
2.3       1            1         a
2.3       2            1         b
3.3       2            2         b
查询排除块id和价格带id相同的原始数据。在你必须带club_id=6的地方,请试试这个

SELECT
  DISTINCT 
  A.Price,B.block_id,B.price_band_id,B.row 
FROM 
    price_band A
INNER JOIN price_band_seat B 
ON A.id = B.price_band_id
WHERE A.club_id = 6

“请提供查询”-这不是本网站的工作方式。所以这不是免费的编码服务。你需要先自己做一些适当的尝试来解决这个问题。然后,如果您的现有代码遇到了一些特定的问题,我们可以帮助您解决这些问题。但这意味着你需要发布你的尝试。你还应该确保添加相关的标签。该问题是一个纯SQL问题,因此您应该删除结果块id和价格带id第1行中的php、mysqli和phpmyadmin标记(因为它们与问题没有直接关系)。@Magnueriksson选择
价格带座位
*,
价格
显示名称
,将
定价带
id
作为
定价带
定价带
内部连接
定价带
定价带
id
=
定价带
定价带
其中
俱乐部id
=6@Deepak中没有重复的行结果。是您的表名价格带还是其他什么?