摘要:
-- 起始值为2,获得所有父节点(包括自己) SELECT * FROM ( SELECT @r AS _guid, (SELECT @r := superguid FROM `table` WHERE guid = _guid) AS superguid, @l := @l + 1 AS lvl 阅读全文
摘要:
mysql order by code REGEXP '^[0-9]',CONVERT(code USING gbk),cast( code REGEXP ('-?[0-9]+') AS unsigned INT ) oracle order by REGEXP_SUBSTR( code,'[[:a 阅读全文
摘要:
CREATE OR REPLACE FUNCTION MD5_BILLDESIGN(passwd IN VARCHAR2) RETURN VARCHAR2 IS retval varchar2(32); BEGIN retval := utl_raw.cast_to_raw(DBMS_OBFUSCA 阅读全文
摘要:
DELIMITER $$ CREATE FUNCTION `pinyin`(P_NAME VARCHAR(255)) RETURNS varchar(255) CHARSET utf8 DETERMINISTIC BEGIN DECLARE V_COMPARE VARCHAR(255); DECLA 阅读全文
摘要:
一、(行转列、列转行) 方法简介 1、使用case…when…then 2、使用SUM(IF()) 生成列 3、使用SUM(IF()) 生成列 + WITH ROLLUP 生成汇总行 4、使用SUM(IF()) 生成列,直接生成汇总结果,不再利用子查询 5、使用SUM(IF()) 生成列 + UNI 阅读全文
摘要:
with recursive t1(id, parent_id) as ( select*from blog_temp.etc_test t0 where t0.parent_id is null -- Anchor member. union all select t2.id, t2.parent 阅读全文