Skip to content

count and group by not working  #1693

Closed
@utpal93

Description

@utpal93

I'm trying to use group by and count together in a query but the count always returns null. Please help me with this

DB::table('contracts')->groupBy('code', 'status') ->select(DB::raw('COUNT(*) as count')) ->having('count', '>', 1) ->get()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions