zoukankan      html  css  js  c++  java
  • sql笔记

     一 、查询重复的id记录,和条数 ,这里主要要说明的是having 用法

    select  ID,COUNT(ID) from Nationality_Map  group by  ID having COUNT(ID)>=2 ;

    二、存储过程中 参数做条件 

       这个不是第一次看见了,但是一直没有弄明白它有何用,今天花时间来实践一下,并把结果写出来,算做一个小记录吧!

      查询 

    select * from test

    结果

    创建存储过程查询

    create procedure [dbo].[yy] (  @id int  ) 
    as 
    begin 
    select * from test where  @id=120

    执行存储过程结果

    修改存储过程查询条件

    alter procedure [dbo].[yy] @id int  
    as 
    begin 
    select * from test where  @id>30
    end 

    执行结果

    结果总结得出。参数作where查询条件,要么是查询全部,要么为空。

  • 相关阅读:
    Android应用增量更新
    corner2
    UIProject
    Argo
    flower-recognition
    Android-Chat-Widget
    leanchat-android
    Beautyacticle
    XianBicycle
    完整性约束(章节摘要)
  • 原文地址:https://www.cnblogs.com/annabook/p/4371864.html
Copyright © 2011-2022 走看看