cur = conn.cursor() sql = "SELECT t.ALL_SSQ_ID FROM ANALYZE_INDEX t " # 和值在74到129概率最大 if sum_flag: # 和值大于102 sql=sql+" WHERE t.sum_value>102 and t.sum_value<129" else: # 和值小于102 sql=sql+" WHERE t.sum_value<102 and t.sum_value>74" sql = get_sql_id_list_str(sql, alternative_results) try: # 执行sql语句 cur.execute(sql) ABC = cur.fetchall() # cur.execute(sql) # 提交到数据库执行 # conn.commit() except Exception as e: print(e) # 如果发生错误则回滚 conn.rollback() cur.close() conn.close() return ABC if __name__ =='__main__': # insertAllData() results=get_last_one_data() analyzeBySumValue(results)
matrix_list.extend(list(itertools.combinations(list04, 6))) matrix_list.extend(list(itertools.combinations(list05, 6))) matrix_list.extend(list(itertools.combinations(list06, 6))) matrix_list.extend(list(itertools.combinations(list07, 6))) matrix_list.extend(list(itertools.combinations(list08, 6))) matrix_list.extend(list(itertools.combinations(list09, 6))) matrix_list.extend(list(itertools.combinations(list10, 6))) matrix_list.extend(list(itertools.combinations(list11, 6))) matrix_list.extend(list(itertools.combinations(list12, 6))) matrix_list.extend(list(itertools.combinations(list13, 6))) matrix_list.extend(list(itertools.combinations(list14, 6))) matrix_list.extend(list(itertools.combinations(list15, 6))) matrix_list.extend(list(itertools.combinations(list16, 6))) else: print("备选号码必须为12个数") return matrix_list if __name__ =='__main__': last_one=get_last_one_data() selected_num_list=[1,2,3,14,16,17,19,21,24,25,28,33] results=get_matrix_f7_12_6_5(selected_num_list) print(len(results)) # for i in results: # x=set(last_one) # y=set(i) # a=x.intersection(y) # if len(a)>=4: # print(i)