zoukankan      html  css  js  c++  java
  • SQL知识积累

    一.如何插入一个单引号,用insert into t_user values ('''',3);

    二.消息表Message:MessageID  
                             SenderID  发送者ID(对应用户表userID)  
                             ReceiverID 接收者ID(对应用户表userID)
                             MessageTime 发送时间
                            Title 消息标题
                            Body 内容

    用户表UserAccount:

    UserID 

    UserAccount

    UserName

    要查询某个人相关的消息(发送者或接收者为同一个人):
    MessageId,发送者姓名,接收者姓名,消息标题,发送时间

    select  m.messageid,

              s.userid as 发送者ID,

              s.username as 发送者姓名,

              r.userid as 接收者ID,

              r.username as 接收者姓名,

              m.title 
    from t_message m  join t_user s on m.senderid=s.userid  
                                join t_user r on m.receiveid=r.userid

    三.在一个时间段内查询用

                      {and m.MessageTime >= #StartTime#}
                      {and m.MessageTime < DATEADD(DAY,1,#EndTime#)} 

  • 相关阅读:
    angular2监听页面大小变化
    angular如何引入公共JS
    angular使用Md5加密
    angular4模块中标签添加背景图
    angular使用sass的scss语法
    设置angular公共样式表
    更改angular的默认端口
    angular模拟web API
    RN与webview通讯
    shell通过ping检测整个网段IP的网络状态脚本
  • 原文地址:https://www.cnblogs.com/ycdx2001/p/1526362.html
Copyright © 2011-2022 走看看