Skip to content

Return a custom dataset from select #224

Answered by vmihailenco
sagr4019 asked this question in Q&A
Discussion options

You must be logged in to vote

See https://bun.uptrace.dev/playground/

db.NewSelect().
	ColumnExpr("Shippers.ShipperName").
	ColumnExpr("COUNT(Orders.OrderID) AS NumberOfOrders").
	TableExpr("Orders").
	Join("LEFT JOIN Shippers ON Orders.ShipperID = Shippers.ShipperID").
	GroupExpr("ShipperName")

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@sagr4019
Comment options

@vmihailenco
Comment options

Answer selected by sagr4019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants