Welcome Guest, Not a member yet? Register   Sign In
convert query to CI 3 query builder
#1

(This post was last modified: 10-04-2022, 11:29 AM by optic4predator1.)

Code:
Hello team i hope you're doing well i have a query which i want to convert to CI 3 query builder

with t as  (
            select    regexp_substr(TAG_ID,'\d',1,level) as ID
                      ,count(*)                          as NUB_of_POSTS
            from      post 
            connect by ID = prior ID and level <= regexp_count(TAG_ID,'\d') and sys_guid() <> prior sys_guid()
            group by  regexp_substr(TAG_ID,'\d',1,level)
          )
select    NAME
          ,NUB_of_POSTS
from      t join tag using(ID)
Reply
#2

You probably will not get an answer to your question because most users have moved over to
CodeIgniter 4 so they do not have CodeIgniter 3 installed anymore.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

You can't.
Query Builder does not support WITH clause.

Why do you need to use Query Builder?
Reply
#4

@optic4predator1 ,

You might want to try query binding instead (https://codeigniter.com/userguide3/datab...y-bindings). It may give you the results that you are looking for.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB