摘要: 行号:Select UID,(@rowNum:=@rowNum+1) as rowNoFrom a,(Select (@rowNum :=0) ) b 阅读全文
posted @ 2013-05-11 18:29 xki 阅读(165) 评论(0) 推荐(0) 编辑
摘要: CREATE PROCEDURE `justifyGroupNum`() NOT DETERMINISTIC SQL SECURITY DEFINER COMMENT '' BEGIN /*how to run:call justifyGroupNum()*/ DECLARE p_group_id int; declare p_num int; declare stopFlag int; DECLARE cursor_name CURSOR FOR select c_group_id,count(*) as num from `t_group_member` where c_v 阅读全文
posted @ 2013-05-11 18:28 xki 阅读(210) 评论(0) 推荐(0) 编辑
摘要: --对一个表取任意随机数 SELECT * FROM TMP_XF_TEST WHERE ID >= (SELECT FLOOR(RAND() * (SELECT MAX(ID) FROM TMP_XF_TEST))) order by id LIMIT 1;--有条件性的取随机数 SELECT * FROM TMP_XF_TEST WHERE ID >= (SELECT FLOOR(RAND() * ((SELECT MAX(ID) FROM TMP_XF_TEST WHERE GID = 9) - (SELECT MIN(ID) FROM TMP_XF_TEST WHERE G 阅读全文
posted @ 2013-05-11 18:27 xki 阅读(148) 评论(0) 推荐(0) 编辑
摘要: DateTime dt = DateTime.UtcNow; DateTime dt_First = dt.AddDays(-(dt.Day) + 3); //AddDays是日期增加或减少多少天,正数为增加天数,负数为减少天数。 this.dtp.Value = dt_First;一个判断true发生的情况多些时,用"value" == string;false发生的情况多些时,用"value".Equals(string) 阅读全文
posted @ 2013-04-17 00:16 xki 阅读(201) 评论(0) 推荐(0) 编辑
摘要: -- oracleSELECTROUND(10/3,2)FROMdual;selectCEIL(9.1)fromdual;SELECTFLOOR(9.1)fromdual;-- mysqlselectROUND(10/3,2)fromdual;selectCEILING(2.3)fromdual;selectFLOOR(2.1)FROMdual-- 判断数字select*fromw_bas_skuwhereidregexp'[^0-9]';select*fromw_bas_userwhereuser_nameREGEXP'^[0-9]';-- --------- 阅读全文
posted @ 2013-04-17 00:03 xki 阅读(546) 评论(0) 推荐(0) 编辑
摘要: this.dgvHeader.Columns["colDifQty"].HeaderCell.Style.ForeColor = Color.Blue; foreach (DataGridViewRow row in this.dgvChangeCompleteOrder.Rows) { if (Convert.ToBoolean(row.Cells["colCheck"].EditedFormattedValue)) { 阅读全文
posted @ 2013-04-09 16:27 xki 阅读(128) 评论(0) 推荐(0) 编辑