Skip to content

Need help to build sqlkata query without using "SelectRaw" and "WhereRaw" functions #514

@xayaraj

Description

@xayaraj

Need help to build sqlkata query without using "SelectRaw" and "WhereRaw" functions for the sql script below. The difficulty that I found is to not using sql "Date_Add" function. I am somewhat new to sqlkata library. My goal is to master this sql builder framework. Need some guidance. Thanks.

select ShipCountry, avg(Freight) as AverageFreight from northwind.orders
where OrderDate >= Date_Add((select max(orderdate) from northwind.orders), interval -12 month)
group by ShipCountry order by AverageFreight desc limit 3;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions