zoukankan      html  css  js  c++  java
  • sql增删改查

    sql增删改查
    一、插入语句
    insert into [table] ([column],[column],[column])
    values(?,?,?)
    二、删除语句
    delete
    from [table]
    where column = ?
    三、修改语句
    update [table]
    set column = ?
    where column = ?
    四、查询语句
    1)查询单条记录的所有字段
    select *
    from [table]
    where [column] = ?
    2)查询所有记录的所有字段
    select *
    from [table]
    order by [column] asc

    注意!!!
    1.order by column asc代表:以column字段,升序排列。desc为降序
    3)查询给定偏移量的记录的所有字段
    select *
    from [table]
    limit [offset], [limit]

    注意!!!
    1.offset指定从哪个索引开始,默认从0开始
    2.limit指定查询几条记录
    4)查询指定记录的指定字段
    select [column], [column]
    form [table]
    where [column] = ?

  • 相关阅读:
    代码大全2阅读笔记之最后总结
    web商品系统最终版
    web商品系统
    期末总结
    2020/12/13
    2020/12/12
    2020/12/11
    2020/12/10
    2020/12/09
    2020/12/08
  • 原文地址:https://www.cnblogs.com/Ran0707-0721/p/13963513.html
Copyright © 2011-2022 走看看