Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

baqirfarooq's avatar

Query Laravel

I need a select query that display one record from each company. Each company have multiple products in product table. I need exact match criteria. I have following tables. 1) Users 2) Companies 3) Products 4) Industries 5) Product_industry 6) packages 7) media Example: I am search "led". Company xyz have more than 1 products having led in their title i need to display only one record from each company those have "led" products. If someone search "i need led" or "need led" or "required led" query must display led products. Note: Query must be optimized.

0 likes
0 replies

Please or to participate in this conversation.