select count

    0

    2

    lucycodes42

    SQL public snippets

    The SELECT COUNT function returns the number of occurrences of a particular column in a table. The expression in the code uses the AS keyword to create a temporary view of the table. The name of the view is then passed as an input to the SELECT COUNT function. The result of the function is then assigned to the variable ${&[USER_INPUT:2]/(.).*/$&[USER_INPUT:1]/}. This expression calculates the total number of records in the table that have the user_input column value 1.

    Shortcut: s_scount

    SELECT COUNT(*) FROM `$table`;
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.