# error: sql: expected 0 arguments, got 1

- **ID:** `go/database-sql-prepare-query-error`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Providing arguments to a query that has no placeholders, or mismatched placeholders in the SQL statement.

## Version Compatibility

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

## Workarounds

1. **Always use parameterized queries with correct placeholder count** (95% success)
   ```
   query := "SELECT * FROM users WHERE id = ?"
rows, err := db.QueryContext(ctx, query, userID)
   ```

## Dead Ends

- **Adding placeholders without verifying SQL** — May introduce SQL injection risk; use parameterized queries correctly. (60% fail)
