我有这样的数据库,想要返回:
id_user : 5c348f8041dc5 have 2
id_user : 5cfc8a7d33a12 have 1
该怎么做或我应该寻找的教程名称?
谢谢。
答案 0 :(得分:1)
您正在寻找struct ContentView : View {
var horizontalSpacing: CGFloat = 48
var verticalSpacing: CGFloat = 48
var body: some View {
GeometryReader { geometry in
Path { path in
let numberOfHorizontalGridLines = Int(geometry.size.height / self.verticalSpacing)
let numberOfVerticalGridLines = Int(geometry.size.width / self.horizontalSpacing)
for index in 0...numberOfVerticalGridLines {
let vOffset: CGFloat = CGFloat(index) * self.horizontalSpacing
path.move(to: CGPoint(x: vOffset, y: 0))
path.addLine(to: CGPoint(x: vOffset, y: geometry.size.height))
}
for index in 0...numberOfHorizontalGridLines {
let hOffset: CGFloat = CGFloat(index) * self.verticalSpacing
path.move(to: CGPoint(x: 0, y: hOffset))
path.addLine(to: CGPoint(x: geometry.size.width, y: hOffset))
}
}
.stroke()
}
}
}
和COUNT
语句。
https://www.codeigniter.com/user_guide/database/query_builder.html
group_by
结果: