须要注意:假设字段为varchar类型,when后的条件要加上引號 SELECT (CASE marital_status WHEN 0 THEN '已婚' WHEN 1 THEN '未婚' ELSE 'WEIZHI' END) AS marital_status FROM tj_archive WHERE id='D1407280006' 用上面的语句,假设marital_status为空串(而不是null)时.居然查询的结果为"已婚" 最后更改正确结果为: SELECT (CASE…
[抄题]: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place. Example 1: Input: [ [1,1,1], [1,0,1], [1,1,1] ] Output: [ [1,0,1], [0,0,0], [1,0,1] ] [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩…
from math import sqrt import randomimport osfrom sklearn import cross_validation os.chdir("/*")c=[]filename=r'rating.txt'out_train=open(r'train.txt','w')out_test=open(r'test.txt','w')for line in open(filename): items=line.strip().split('|') c.ap…
#!/bin/bash namespace=`kubectl get ns|grep '^te-'|grep -v datamgr|awk '{print $1}'` #--------------------------- for i in $namespace do podname=`kubectl get deploy -n $i |awk 'NR>1{if ($2>0) print $1}'` for j in $podname do kubectl scale --replicas=…