go-zero
go-zero copied to clipboard
mysql sum return err
SELECT sum(total) FROM user WHERE xxxxxx=xxx
sql: Scan error on column index 0, name "sum(total)": converting NULL to uint64 is unsupported
When there is no matching data in the table
use sql.NullInt64 instead
thanks