zoukankan      html  css  js  c++  java
  • java 21-mysql

    >> show databases;

    >>CREATE DATABASE bigdata; 创建

    >> use bigdata;

    >>drop database bigdata; 删除

    >>create table bigdata.mytable(id int ,nane varchar(200)); 创建表

    >>insert into bigdata.mytable(id,nane

    )VALUES(1,'tom'); 插入数据

    >>select  * from  bigdata.mytable where  id=1;查询

    >>update mytable set id=3,nane='test' where id=1 ;更新

    >>DELETE from bigdata.mytable where id=1; 删除数据

    >> drop table bigdata.mytable;删除表

    >>mysql 不区分大小写

    >>select nane,id from  bigdata.mytable where nane like 'j%'; 模糊查询

    >>

    --根据cid求max(price)
    select id,max(price) from ord GROUP BY cid order by id asc ;
    --分组后进行过滤
    select id,max(price) from ord GROUP BY cid having max(price)>10;

    >>select * from t2 limit 3,10; 3表示跳过多少不要,10表示要多少。

    >>select nane,id from  bigdata.mytable where nane like '%t_';   _模糊匹配 t后面的单个字符

    >>desc tablea;

    >>create table  t2 like t1;创建表结构 不含有数据

    >>create table t2 as select * from t1;复制表结构含有数据

    ----cmd的下 netstat -ano 查看端口

     --行转列的显示(仅限于显示相当于自动换行)

    >>select * from ord G;

  • 相关阅读:
    url末尾的斜杠作用
    awk 工具可以很灵活地对文本进行处理,这里的 awk '{print $2}'是指第二列的内容,是运行的程序 ID。 杀死指定进程
    nil和空切片
    WaitGroup源码设计,
    2
    t
    Go内置的定时器
    分布式定时器
    1 2 交换
    order by 1 DESC 2 desc
  • 原文地址:https://www.cnblogs.com/simly/p/11547295.html
Copyright © 2011-2022 走看看