create or replace function get_txt_count(p_source_txt character varying, p_count_txt character varying)returns integeras $get_txt_count$declarev_idx integer := 1v_cnt integer := 0v_source_txt character varying(2000) := p_source_txtv_len integer := length(p_count_txt)begin while v_idx >0 loop v_idx := position(p_count_txt in v_source_txt) if v_idx >0 then v_cnt := v_cnt + 1 v_source_txt := right(v_source_txt, length(v_source_txt) - v_idx - v_len + 1) end if end loop return v_cntend$get_txt_count$ language plpgsql
调用:
select get_txt_count('a.b.c.d.e', '.')
可以用存储过程啊
就可以实现啊
语句也行啊
MYSQL语法
SELECT FLOOR(7 + (RAND() * 6))然后在插入数据
UPDATE `news_conta_all_20141104` SET memo4=CEIL(RAND()*199)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)