# 基本的SQL语句

* **+** 号的使用

  ```
  SELECT  'a11'+11;

  ## 11

  SELECT  '1111'+11;

  ## 1122

  SELECT  null+'aaa';

  ## 为空

  SELECT  null+null;

  ##  为空
  ```
* 调节运输符
  * `<`
  * `>`
  * `<>` 或者`!=`
  * `<=` `>=`&#x20;
* 逻辑运算符
  * `and` 或者`&&`
  * `or`或者`||`
  * `not`或者`!`

    ```
    # id 小于5 并且大于2
    SELECT * FROM websites WHERE  NOT(id>=5) AND id>2 ;
    ```
* 模糊查询
  * like 一般与通配符搭配使用

    `%`匹配任意多个字符，并且`like`不区分大小写

    `_`匹配任意一个字符,类似占位符的功能

    ```
    SELECT * FROM websites WHERE name like 'g%' ;
    # alexa    country    id    name    url
    # 1    USA    1    Google    https://www.google.cm/
    ```
*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zpliu.gitbook.io/booknote/node/mysql/sql-yu-ju.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
