• 常用sql 语句.


    查询是否有小写字母 

    Select * FROM         ICILOC   WHERE     (ITEMNO LIKE '%[a-z]%' COLLATE chinese_prc_bin)

    查询某段时间,是否有空房。

    select *,
    , (gs_stock-isnull(aac.maxqty,0)) as gs_stock from VGoods_FatherCategory_House_Extend left join (select houseorder_gsid,max(houseorder_qty)as maxqty from houseorderdetail where houseorder_date >=@indate and houseorder_date <=@outdate group by houseorder_gsid) AS aac on aac.houseorder_gsid=VGoods_FatherCategory_House_Extend.gs_id

    ×当as 子表失败,注意是否每个字段都有名字或别名。

    如何表示单引号。2个单引号来表示。

    查询某段时间,是否有空房。存储过程。

    ALTER PROCEDURE [dbo].[spGoodsHouseExtend](@indate nvarchar(50),@outdate nvarchar(50),@where nvarchar(50))
    AS
    BEGIN
    SET NOCOUNT ON;
    declare @strsql as nvarchar(2500)
    set @strsql='select * from (
    select house_id, house_gsid, house_area, house_wifi, house_tel, house_type, house_breakfast, house_maxpeoplecount, house_extend, house_window, house_show, gs_id, gs_name, gs_type, gs_spid, gs_price,
    gs_desc, gs_level, gs_smpledesc, gs_smallpic, gs_bigpic, gs_pics, gs_score, gs_extend, gs_keeps, gs_orderrange, sp_id, sp_cgid, sp_display, sp_name, sp_city, sp_address, sp_flag, sp_smallpic,
    sp_bigpic, sp_score, sp_extend, sp_level, sp_status, sp_tels, sp_tel, sp_stare, sp_action, sp_online, sp_goodsWeakOpen, sp_starttime, cg_fatherid, cg_name, cg_pic, cg_extend, sp_validdays,
    sp_goodsRule
    , (gs_stock-isnull(aac.maxqty,0)) as gs_stock ,isnull(aac.maxqty,0) as bb from VGoods_FatherCategory_House_Extend left join (select houseorder_gsid,max(houseorder_qty)as maxqty from houseorderdetail where houseorder_date >='''+@indate+''' and houseorder_date <='''+@outdate+''' group by houseorder_gsid) AS aac on aac.houseorder_gsid=VGoods_FatherCategory_House_Extend.gs_id
    ) as abc '+@where

    execute(@strsql);
    END

  • 相关阅读:
    Go HTTP Client 持久连接
    监控指标go.mongodb.org/mongodriver的prometheus
    Mybatis拦截器自定义prometheus监控指标
    Springboot开启prometheus监控指标获取HTTP请求的吞吐时延等
    Golang 环境变量详解
    Navicat
    springboot单元测试常用写法
    golang枚举值定义
    java 实现 类似 reids nx锁 , 模拟秒杀操作
    分布式幂等1(基于一次性token) 自定义接口幂等(注解) @AvoidResubmit(isLoc = false)
  • 原文地址:https://www.cnblogs.com/lsfv/p/3224527.html
Copyright © 2020-2023  润新知