如何在Laravel中进行MYSQL查询

问题描述 投票:-1回答:1

我在MySQL中有一个查询,需要更改为Lavarel。

如何在Laravel中进行此查询:

 select distinct (
        select distinct
        products.name
        FROM
        products 
        join topics on topics.product_id = products.id ) AS product

    from 
    contents c
    join content_topics on content_topics.content_id = c.id
    join topics b on b.id = content_topics.topic_id 
    where contents.id = 778;
mysql laravel
1个回答
0
投票

据解释,它是关于原始查询的原始记录。https://laravel.com/docs/5.8/database#running-queries

© www.soinside.com 2019 - 2024. All rights reserved.