1.case语句 用于选择语句 SELECT ProductNumber, Category = CASE ProductLine WHEN 'R' THEN 'Road' WHEN 'M' THEN 'Mountain' WHEN 'T' THEN 'Touring' WHEN 'S' THEN 'Other sale items' ELSE 'Not for sale' END, Name FROM Production.Product ORDER BY ProductNumber; 用于u…
SELECT CONVERT(varchar(100), GETDATE(), 23) AS 日期 结果:2017-01-05 select ISNULL(price,'0.0') FROM table 将表中为null的值变成0.0 select * from [DBData].[dbo].[T_Student] where [Name]='LILEI' 等效于: select * from [DBData].[dbo].[T_Student…
1.map map是python内置的高阶函数,它接收一个函数和一个列表,函数依次作用在列表的每个元素上,返回一个可迭代map对象. class map(object): """ map(func, *iterables) --> map object Make an iterator that computes the function using arguments from each of the iterables. Stops when the shortes…
1.COALESCE( value1,value2,... ) The COALESCE function returns the fist not NULL value from the list of values. If all the values in the list are NULL, then it returns NULL. Example: COALESCE(NULL,NULL,5,NULL,4) returns 5: coalesce()函数,在处理空值时,'' 和NULL…
1.变量和参数的设置 //将IP地址和端口放入到参数中lr_save_string("192.168.1.133:8081","ip"); //计算变量数组的元素个数int arr_m1[100]; int len1=0len1=sizeof(arr_m1)/sizeof(int); //返回值字符串的长度char *tempStr="test is a house";int len=0;len=strlen(tempStr); //在globa…
//LTrim(string):去除左边的空格 function LTrim(str) { var whitespace = new String(" \t\n\r"); var s = new String(str); if (whitespace.indexOf(s.charAt(0)) != -1) { var j = 0, i = s.length; while (j < i && whitespace.indexOf(s.charAt(j)) != -1…
1.js 获取文件后缀名 <script type="text/javascript"> var filename="www/data/index.php"; var index1=filename.lastIndexOf("."); var index2=filename.length;alert(index2); var postf=filename.substring(index1,index2);//后缀名 alert(pos…