# sql: Scan error on column index 1: converting driver.Value type []uint8 ("123") to a int64: invalid syntax

- **ID:** `go/sql-scan-type-mismatch`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Database returns a string representation of a number, but target is int; conversion fails.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.21 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   Scan into a string first, then parse: var s string; rows.Scan(&s); num, _ := strconv.Atoi(s)
   ```
2. **** (90% success)
   ```
   Use sql.NullInt64 and handle invalid: var n sql.NullInt64; rows.Scan(&n); if n.Valid { use n.Int64 }
   ```

## Dead Ends

- **** — May not be possible or desirable; schema changes risky. (40% fail)
- **** — Data loss; incorrect results. (90% fail)
