Mysql 使用三个表进行灵活的搜索或sql查询?

Mysql 使用三个表进行灵活的搜索或sql查询?,mysql,sql,hybris,Mysql,Sql,Hybris,我有三张桌子:订单、客户、地址 我是否知道如何在灵活搜索中连接三个表,以找出客户订单的交付地址(主/默认地址或辅助地址) 注意:主地址是在客户注册期间创建的地址。您想要这样的地址吗 select {order.deliveryAddress} from {Order as order},{Customer as customer} where {order.user}={customer.pk} and {customer.uid} = ?customerID 或 或 请将一些示例数据和预期输

我有三张桌子:订单、客户、地址

我是否知道如何在灵活搜索中连接三个表,以找出客户订单的交付地址(主/默认地址或辅助地址)


注意:主地址是在客户注册期间创建的地址。

您想要这样的地址吗

select {order.deliveryAddress} from {Order as order},{Customer as customer} where {order.user}={customer.pk} and {customer.uid} = ?customerID


请将一些示例数据和预期输出添加到您不应该直接使用sql查询的问题中,请始终在hybris中使用FlexibleSearch!
select {address.pk} from {Order as order},{Customer as customer},{Address as address} where {order.deliveryAddress}={address.pk} and {order.user}={customer.pk} and {customer.uid} = ?customerID
select {order:deliveryAddress} from {Order as order JOIN Customer as customer ON {order:user}={customer:pk}} where {customer:uid} = ?customerID