title: How to use split_part of postgresql inside laravel?
body: <p>I want to use <a href="https://www.postgresqltutorial.com/postgresql-split_part/" rel="nofollow noreferrer">split_part</a> inside laravel. My code is like, </p>
  
  <pre><code>$results = DB::table('zaiko')
                 -&gt;where('soukobango',$souko_bango_for_joining)
                 -&gt;join('syouhin1','zaiko.syouhinbango','=','syouhin1.bango')
                 -&gt;where('syouhin1.isphoto','is distinct from','1')
                 -&gt;select('syouhin1.bango',
                      'syouhin1.kokyakusyouhinbango',
                      'syouhin1.jouhou',
                      'syouhin1.tokuchou',
                      "SPLIT_PART('zaiko.datachar02', '|', 1) as test1")
                -&gt;get();
  </code></pre>
  
  <p>However, it is giving me the following error. </p>
  
  <blockquote>
    <p>Undefined table: 7 ERROR: missing FROM-clause entry for table
    "SPLIT_PART('zaiko" LINE 1: ...ngo", "syouhin1"."jouhou",
    "syouhin1"."tokuchou", "SPLIT_PAR... ^ (SQL: select
    "syouhin1"."bango", "syouhin1"."kokyakusyouhinbango",
    "syouhin1"."jouhou", "syouhin1"."tokuchou",
    "SPLIT_PART('zaiko"."datachar02', '|', 1)" as "test1" from "zaiko"
    inner join "syouhin1" on "zaiko"."syouhinbango" = "syouhin1"."bango"
    where "soukobango" = 1 and "syouhin1"."isphoto" is distinct from 1)</p>
  </blockquote>
  
  <p>But if I remove the line with SPLIT_PART then it works as expected. </p>