Skip to content

how to make an advanced query  #1062

Closed
Closed
@whistlesun

Description

@whistlesun

if the sql is dynamic , how to use sqlc ?
for example:

/* name: ListAuthors :many */
SELECT * FROM authors where id = ? and name = ? and age = ? and school = ? and article_count = ?
ORDER BY name;

There is a multi query , if id and age is not set , the where condition can be omitted ,like this
SELECT * FROM authors where age = ? and school = ? and article_count = ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions