摘要:
select a.* from table a where 10 > (select count(*) from table b where b.dif_distance = a.dif_distance and b.id > a.id ) order by a.id-- 按照dif_distanc 阅读全文
摘要:
static int answer = 0; static int N = 4;//皇后数 static int[] queen = new int[N + 1]; private static void putQueen(int j) {// 第几个皇后 for (int i = 1; i <= 阅读全文
摘要:
1.判断数据是否存在 -- 通常写法,查出条件下的数据数量count SELECT count(*) FROM table WHERE a = 1 AND b = 2 2.提升效率写法 -- 使用Limit1 , 避免资源过度扫描 SELECT 1 FROM table WHERE a = 1 AN 阅读全文