摘要:
for(初始条件;比较;状态改变 ){循环体}//打印100遍hellowordfor(int i=0;i1;m--){for(intn=1;nm;l--){Console.Write("☆");}Console.Write("\n");}////左上for(intm=1;mm;n--){Conso... 阅读全文
摘要:
//判断是否是闰年 int b = int.Parse(Console.ReadLine()); if (b % 4 == 0 && b % 100 != 0) { Console.WriteLine("是闰年"); } else if (b % 400 == 0) { Console.WriteL... 阅读全文
摘要:
static void Main(string[] arges){//数学运算符 加减乘除模int a=1;int b=2;int c=a+b;c=1+14%13;Console.WriteLine(c);//递增运算符c=a++ //"a++"等于“a=a+1”,先执行C的操作,再执行 a 的操作... 阅读全文
摘要:
---恢复内容开始---//注释一行using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;//命名空间namespace first... 阅读全文
摘要:
视图:把一个查询结果集当作表例:select * from (select * from score,grade where score.degree between low and upp) as jieguotable where rank='A' as 后面的作为一个虚拟的表create vi... 阅读全文
摘要:
---存储过程alter proc ChaXunasbeginselect *from Scoreendgo--执行exec chaxun--删除drop proc chaxun--输入参数的存储过程alter proc jiayibai@shuru int,@canshu intasbeginpr... 阅读全文
摘要:
一、定义变量declare @sum int --变量名以@开头,后面接数据类型二、变量赋值set @sum=1 三、变量使用print @sum --不能单独执行次命令,需要与上两个变量配合例:declare @string varchar(20) set @string='abcdefg' se... 阅读全文
摘要:
一、字符串函数 String FunctionsASCII:返回字符串最左侧字母的ASCII码 对应的为char,将ASCII码转化为字符charindex:在一个表达式中搜索另一个表达式,并返回其位置例:print charindex('de','abcdefg') ---其结果为4,逗号前为被查... 阅读全文
摘要:
一、聚合函数(Aggregate Functions)AVG:求平均 count:计算个数 MAX:最大值MIN:最小值SUM:求和例:select count(*) as 人数 from student--as 人数,列名显示为“人数”select(select count (*) from st... 阅读全文
摘要:
一、多个条件查询:in、between select * from category where parent='013' or parent='12' or parent='011'等于select * from category where parent in ('011',''012','01... 阅读全文