zoukankan      html  css  js  c++  java
  • sql 语句操作

    插入:insert into table1(field1,field2) values(value1,value2) 

    db.execSQL(sql)

    db.execSQL(sql, bindArgs)

    1):

    str = "insert into UMUserMapStore(StoreID,UserID,LStoreID,IsValid) values("
           + operator.StoreID
           + ","
           + empSetStore.UserID
           + ","
           + operator.LStoreID + ",'Y')";

    db.execSQL(str);

    2):

    db.execSQL(
          "insert into UMUserMapStore(StoreID,UserID,LStoreID,IsValid) values(?,?,?,?)",
          new Object[] { operator.StoreID, empSetStore.UserID,
            LStoreID, "Y" });

    更新:update table1 set field1=value1 ,field2=value2 where  范围

            str = "update UMUserMapStore set IsValid='N' where UserId="
                + empSetStore.UserID;

             db.execSQL(str);

    删除:delete from table1 where 范围

           str = "delete from UMUserMapStore where UserId="
                + empSetStore.UserID;

            db.execSQL(str);

     查询:

    SELECT column_name(s) FROM table_name  WHERE column_name   IN (value1,value2,..)

    select * from table1 where field1 like “%value1%”---like

          str=SELECT COUNT(1) FROM M2Store WHERE 1=1 AND MerchantID=44 AND Status='Y' and IsValid='Y';

          db.execSQL(str);

        

      

  • 相关阅读:
    基于Asp.Net webApi owin oauth2的实现
    动态赋值
    C#生成二维码
    深度学习中反卷积层(转置卷积)引起的棋盘格噪声
    batch normalization 批归一化 --- 一个硬币的两面
    FFMPEG常用命令-格式转换-持续更新中
    [译]CRF和QP的区别
    读懂NCHW和NHWC
    [译]GPUView
    有一次接口设计
  • 原文地址:https://www.cnblogs.com/yujian-bcq/p/3503293.html
Copyright © 2011-2022 走看看