0

Showing error when using FIND_IN_SET in Laravel and PostgreSQL

SQLSTATE[42883]: Undefined function: 7 ERROR: function find_in_set(uuid, character varying) does not exist LINE 1

$companyData = DB::table('companies')
                ->select('companies.*')
                ->leftjoin("industries",\DB::raw("FIND_IN_SET(industries.id,companies.indusrty_id)"),">",\DB::raw("'0'"))
                ->where('companies.id',$companyId)
                ->get();

Code After suggestion from comments

$companyData = DB::table('companies')
                ->select('companies.*')
                 ->join('industries', function($join)
                    {
                         $join->on('companies.indusrty_id', '=', 'industries.id')
                         ->where('industries.id', '=', any (string_to_array('companies.indusrty_id',',')));
                    })
                ->where('companies.id',$companyId)
                ->get();

now showing Call to undefined function App\Http\Controllers\any()

Table Schema

0 Answers0