摘要:
order by 1.升序 # 将employee表中的记录安装age字段中的数据升序排列。(默认为升序"asc"可不写) select * from employee order by age asc; 2.降序 # 将employee表中的记录安装age字段中的数据降序排列。 select * 阅读全文
摘要:
可以按照任意字段分组,但是分组完毕后,比如group by post,只能查看post字段,如果想查看组内信息,需要借助于聚合函数。聚合函数: max 最大值 min 最小值 avg 平均值 sum 求和 count 总数 # 查询每个post字段下id的记录个数。 select post,coun 阅读全文
摘要:
1.互斥锁 import time from threading import Thread,Lock def func1(lock): global n lock.acquire() #加锁 temp = n time.sleep(0.2) n = temp -1 lock.release() # 阅读全文
摘要:
1.多线程并发 from threading import Thread import time def func(n): time.sleep(1) print(n) for i in range(10): t = Thread(target=func,args=(i,)) #将函数注册进子线程, 阅读全文