MySQL basics --- data query 01

  1. Query all information
    select * from table name;
  2. Query the corresponding column
    select column name to be viewed 1, column name to be viewed 2 ... from table name;
  3. Take alias
    select column name to view 1 [as] alias, column name to view 2 [as] alias… from table name;
  4. Filter duplicate data
    select distinct column name from table name; (column name is the name of the filtered column)
  5. The selection
    column is an expression: Select column name (number type column) * 0.8 from table name;
    Ceil (value): round up example: ceil (321.1) = 322
    Floor (value): round down example: floor ( 321.9) = 321
    Round (value): round to five rounds Example: Round (321.1) = 321 Round (321.9) = 322
  6. Query condition
    Select * from table name where condition
  7. Relational operator

<> = <=! = (<>) Is not equal to =

  1. Logical operator
    And (both)
    Or (or)
    Not (negated)
    isNull (is empty)
Published 32 original articles · Likes 96 · Visits 1583

Guess you like

Origin blog.csdn.net/qq_44534541/article/details/105500995