1 year ago

Laravel query builder

Posted 1 year ago by deepu07

Hey folks, I'm stuck-up with query builder. I wanna merge duplicate column values into one row.

for example I have

id  name    age     rollnum
1   bob     24      null            
2   bob     24      1234

i wanna see 1 bob 24 1234. How can i do that in below query. Any help that would be appreciated. Thanks in advance.

`//Query Builder

    $data = \DB::table("table1 AS a")
          id, name, age, COUNT(*),
          FROM table2
          GROUP BY, b.age
          HAVING count(*) > 1
          ) as b"), function($join){
            $join->on("", "=", "")->on("a.age", "=", "b.age")->on("", ">", "");


Please sign in or create an account to participate in this conversation.