MySQL存储过程循环问题

DELIMITER $$
CREATE PROCEDURE insert_pro(IN usidS VARCHAR(50),IN usidE VARCHAR(50),IN uutype INT(11),IN uulevel INT(11))
BEGIN
DECLARE $existsFlag INT DEFAULT 0;
DECLARE usid INT(50);
//判断同种type和level的记录是否存在
SELECT id INTO $existsFlag FROM zy WHERE utype=uutype AND ulevel=uulevel;
IF $existsFlag = 0
THEN
//判断其实序号在数据库中是否已存在
SELECT id INTO $existsFlag FROM zy WHERE sid>=usidS+0 AND sid<=usidE+0;
IF $existsFlag = 0
SET usid=(usidS+0);
//如果都不存在,则以起止序号为sid,循环插入相同level相同type记录若干
WHILE usid<=(usidE+0) DO
INSERT INTO zy(sid,utype,ulevel) VALUES(usid+'',uutype,uulevel);
END IF;
SET usid=(usid+1);
END WHILE;
END $$
目前一直在‘SET usid=(usidS+0);’附近报错,不知是何原因,求大神指点

1个回答

usidS VARCHAR(50) ;这个是字符串变量,怎么进行int加减

java_LittleBird
java_LittleBird 字符串+0转为整数,只是 会略掉前面的0
2 年多之前 回复
java_LittleBird
java_LittleBird 你好,这个是产生的证书编号,是字符串的类似"0001"到"1000",我需要将它转换为int,进行递增插入
2 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
mysql存储过程循环只执行一次
下面是存储过程主体,问题是无论怎么跑,貌似里面的两个循环都只会执行一次。好困惑。请sql大神解救 BEGIN DECLARE stop_flag INT DEFAULT 0; DECLARE captain VARCHAR(500); DECLARE captain1 VARCHAR(500); DECLARE captain2 VARCHAR(500); declare captainstaffno1 varchar(32); declare captainstaffno2 varchar(32); declare crwPilotInf varchar(500); DECLARE leftSeat VARCHAR(200); DECLARE rightSeat VARCHAR(200); DECLARE controller VARCHAR(200); DECLARE ti_code varchar(32); declare flightNo VARCHAR(32); DECLARE flightDate datetime; declare to_airport varchar(32); declare ld_airport varchar(32); declare observers varchar(500) DEFAULT ''; declare observerIds varchar(500) default ''; declare observerText varchar(500); declare observerNames varchar(100); declare observerId varchar(100); DECLARE leftSeat_SID VARCHAR(200); DECLARE rightSeat_SID VARCHAR(200); DECLARE controller_SID VARCHAR(200); #定义游标 DECLARE cur1 CURSOR FOR select tiCode, FLIGHT_NO, datop, tiAirDromeBegin, tiAirDromeEnd, tiLeftSeat, tiRightSeat, tiControl from ODS.T_FLIGHT_SEGMENTS_REPORT WHERE datop between '2014-02-01' and '2014-02-28'; DECLARE CONTINUE HANDLER FOR NOT FOUND SET stop_flag=1; ​ open cur1; WHILE stop_flag = 0 DO FETCH cur1 INTO ti_code,flightNo,flightDate,to_airport, ld_airport,leftSeat,rightSeat,controller; SET @sqlexec:=concat('select CRWPILOTINF,CAPTAIN1,CAPTAINSTAFFNO1,CAPTAIN2,CAPTAINSTAFFNO2 into @crwPilotInf, @captain1, @captainstaffno1, @captain2, @captainstaffno2 from ODS.T_FLIGHT_REPORT_SPL where FLTIDS=\'',flightNo,'\' and DATE_FORMAT(FLTDATE,\'%Y-%m-%d\')=\'',flightDate,'\' and TO_AIRPORT=\'',to_airport,'\' and LD_AIRPORT=\'',ld_airport,'\';'); prepare stmt from @sqlexec ; execute stmt; deallocate prepare stmt ; set crwPilotInf = @crwPilotInf; set captain1 = @captain1; set captainstaffno1 = @captainstaffno1; set captain2 = @captain2; set captainstaffno2 = @captainstaffno2; SET @i = 1; SET @count=CHAR_LENGTH(crwPilotInf)-CHAR_LENGTH(REPLACE(crwPilotInf,';','')) + 1; IF IFNULL(@count,0) > 0 THEN WHILE @i <= @count DO set observerText = SUBSTRING_INDEX(SUBSTRING_INDEX(crwPilotInf,';',@i),';',-1); set observerNames = SUBSTRING_INDEX(SUBSTRING_INDEX(observerText,':',1),':',-1); set observerId = SUBSTRING_INDEX(SUBSTRING_INDEX(observerText,'+',2),'+',-1); select @i,observerText,observerNames,observerId; if (observerText REGEXP captain1) > 0 then select (observerText REGEXP captain1); ELSEIF (observerText REGEXP captain2) > 0 then select (observerText REGEXP captain2); ELSEIF (observerText REGEXP leftSeat) > 0 then update ODS.T_FLIGHT_SEGMENTS_REPORT a INNER JOIN STG.IF_TASKINFOAIRCREWS_TMP b on a.tiCode=b.TICODE set a.LEFTSEAT_PILOT_ID=b.SID where b.TICODE=ti_code and b.MNAME=leftSeat; ELSEIF (observerText REGEXP rightSeat) > 0 then update ODS.T_FLIGHT_SEGMENTS_REPORT a INNER JOIN STG.IF_TASKINFOAIRCREWS_TMP b on a.tiCode=b.TICODE set a.RIGHTSEAT_PILOT_ID=b.SID where b.TICODE=ti_code and b.MNAME=rightSeat; ELSEIF (observerText REGEXP controller) > 0 then update ODS.T_FLIGHT_SEGMENTS_REPORT a INNER JOIN STG.IF_TASKINFOAIRCREWS_TMP b on a.tiCode=b.TICODE set a.CONTROL_PILOT_ID=b.SID where b.TICODE=ti_code and b.MNAME=controller; ELSE SET observers = concat(observers, observerNames,','); SET observerIds = concat(observerIds, observerId,','); END IF; SET @i=@i+1; END WHILE; END IF; UPDATE ODS.T_FLIGHT_SEGMENTS_REPORT SET OBSERVER_PILOT_ID=observerIds, OBSERVER_NAME=observers where FLIGHT_NO=flightNo and datop=flightDate and tiAirDromeBegin=to_airport and tiAirDromeEnd = ld_airport; SET observers=''; SET observerIds=''; COMMIT; END WHILE; CLOSE cur1; END 麻烦大神们都帮忙看看,问题出在哪里。怎么解决? ps:没有c币了。各位慷慨一下
新人:mysql存储过程求问
各位老师,由于工作需要,最近学了mysql。这段时间也看了许多有关存储过程的教程和案例。但还是摸不着头脑。这里要请教大家,mysql存储过程具体应该如何实现。(给我个大概得框架就行) 这里需要用manager_id=human_id这个条件,找出符合条件的thuman,就如我图3。 但是接下来还要用新求出来的thuman_id=human_id这个条件循环查询出manager下面的thuman信息。 这个本人认为要用到存储过程循环查询建表和插入。但由于个人技术水平原因,求各位不啬赐教。可以不用具体代码,就大概框架。![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/3.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/3.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/3.gif)![图片](https://img-ask.csdn.net/upload/201512/10/1449710031_830843.jpg)![图片](https://img-ask.csdn.net/upload/201512/10/1449709994_791392.jpg)![图片](https://img-ask.csdn.net/upload/201512/10/1449710004_599181.jpg)
mysql 存储过程中的问题
大概我想要的结果是这样: 可以通过存储过程,用主键(id)查询到该节点的所有祖先,表的设计是自连接。 CREATE TABLE channel ( id INT(11) NOT NULL AUTO_INCREMENT, cname VARCHAR(200) DEFAULT NULL, parent_id INT(11) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=INNODB DEFAULT CHARSET=utf8; INSERT INTO channel(cname,parent_id) VALUES ('张三',-1),('张得帅',1),('张飞',1),('张学友',2),('张苞',3); 怎么写这个存储过程呢 其实就是存储过程当中的循环应该怎么写呢。比如我想找到‘张苞’的所有祖先。同过call find_all_father(5),就可以查询到了,我该怎么实现
关于mysql存储过程游标只循环一次
DELIMITER $$ CREATE PROCEDURE `comment_count_sp` () BEGIN -- 需要定义接收游标数据的变量 DECLARE news_id_bak INT(11); DECLARE news_count INT(11); DECLARE count_all INT(11) DEFAULT 0; -- 遍历数据结束标志 DECLARE done INT DEFAULT FALSE; -- 游标 DECLARE cur CURSOR FOR ( SELECT news_info_id news_id_bak,COUNT(news_info_id) news_count FROM t_news_comment WHERE STATUS = 1 GROUP BY news_id_bak ORDER BY news_count ASC ); -- 将结束标志绑定到游标 DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; SET done = FALSE; -- 打开游标 OPEN cur; -- 开始循环 read_loop: LOOP FETCH cur INTO news_id_bak,news_count; IF done THEN LEAVE read_loop; END IF; SET count_all = count_all + 1; END LOOP; SELECT count_all; -- 关闭游标 CLOSE cur; END 这个存储过程为什么count_all总是1,快崩溃了
nodejs调用mysql存储过程,怎么返回多集合
新手学习,存储过程中循环查询出多个结果集,怎样在nodejs中正确获取。单条查询结果可以获取,多条结果无从下手啊!
MySQL如何通过命令停止执行中的存储过程
在开发一个项目的过程当中,有个场景是这样的,通过在存储过程里面循环的执行一个更新操作,执行的过程会持续比较长时间,这个时候操作员会根据现场的情况,把更新操作停止,改为手动更新模式。 根据这个现实的需要,通过查资料,可以通过获取当前执行Sql的Id进行操作,我是想在程序调用的时候获取当前调用此存储过程的Id,然后根据此Id将存储过程Kill,但是找不到方法获取调用存储过程的Id,我发现在nivate里面有个功能是停止正在运行的sql,我试了下存储过程在执行过程中也可以停止,但是不知道如何实现,请问各位老师有没有什么好的解决方案或者思路,请不吝赐教,感谢!
MySQL存储过程ITERATE和LEAVE
这两个语句ITERATE是用来跳出本次循环,进入下一个循环的,LEAVE是跳出整个循环,请举个例子说明是怎么跳出循环的?![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/21.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/21.gif)
mysql 存储过程select a into b当第一次循环有记录,第二次循环没有记录时,b会赋值为上一次循环的值
``` declare v_id int; declare usrcur cursor for select name form t_app_tbl where enable=1; declare continue handler for NOT FOUND set done=1; open usrcur; usrloop :LOOP fetch usrcur into usr_name; if done=1 then leave usrloop; end if; select id into v_id from t_mer_tbl where name = usr_name; ``` loop循环多次时,当前一次循环v_id有值,下一次循环没有记录时,v_id会 赋值为上次一循环的v_id;为什么会这样,正常不是应该是null吗?
请教:MYSQL存储过程‘LOOP’语句怎么查看显示结果
下面是一个“LOOP”语句的存储过程,有跳出循环的语句,调用该存储过程,查看显示的结果。 CREATE PROCEDURE doloop() BEGIN DECLARE a int default 0; add_num:LOOP SET a=a+1; IF a>10 THEN LEAVE add_num; END IF; END LOOP add_num; END
mysql存储过程中(varchar)变量的问题
DELIMITER $$ DROP PROCEDURE IF EXISTS `codebush`.`sp_truncate_all_table` $$ CREATE PROCEDURE `sp_truncate_all_table`() BEGIN declare done INT DEFAULT 0; declare tbl varchar(64); declare cur_tbl cursor for select table_name from information_schema.tables where table_schema = 'codebush' and table_type='base table'; declare continue handler for not found set done = 1; open cur_tbl; repeat fetch cur_tbl into tbl; truncate table tbl; until done end repeat; close cur_tbl; END $$ DELIMITER ; 上面的存储过程我一执行 CALL sp_truncate_all_table() 就报 [color=red][size=large]Table 'codebush.tbl' doesn't exist[/size][/color]我是想把codebush数据库中的数据清空,循环执行 truncate table tbl; tbl是定义的变量,通过cursor取得表名,然后truncate那个表。mysql把tbl不当作变量赋值,直接把tbl当作了表名,就报了tbl那个表不存在。大家有什么好的解决方法呢?
mysql批量更新存储过程怎么写
我要写个存储过程,传入记录数N。 然后查找出按积分排序的前N条记录,然后循环设置记录的排名=i. 请问能给个demo么。
Java连MySql数据库存储过程内使用while循环递归至分类根节点的问题~~
<pre name="code" class="sql">label_proc: begin declare v_category_inner_code int; declare v_rootid int default null; declare v_tempid int default null; declare v_listid varchar(1000) default 'aaa'; set v_category_inner_code = p_category_inner_code; while (v_category_inner_code is not null) do begin if exists (select * from pu_productcategory where category_inner_code = v_category_inner_code) then select category_inner_code,up_inner_code into v_tempid,v_category_inner_code from pu_productcategory where category_inner_code = v_category_inner_code; else select v_category_inner_code; set v_category_inner_code = null; end if; end; end while; select * from pu_productcategory where category_inner_code = v_category_inner_code; end label_proc</pre> <pre name="code" class="sql">如上代码:mySQL存储过程 需传入一个参数p_category_inner_code int,数据表结构主要就一个category_inner_code分类编号 和上up_inner_code上级分类编号,我想根据p_category_inner_code 传入的参数递归查询</pre> <pre name="code" class="sql">出该分类的最根级分类,就一个while简单的循环不错那里了,就是没结果出来,好象变成死循环了,我感觉我做的没错啊,希望高手来解决,本人mysql新手。</pre> <p> </p> <p><strong> 呵呵,自己解决了,错在这步:select category_inner_code,up_inner_code into v_tempid,v_category_inner_code  from pu_productcategory where category_inner_code = v_category_inner_code;原本是想根据v_category_inner_code来取记录并把up_inner_code 给v_category_inner_code赋值一步完成,下次递归循环查询的就是ID为这条记录的上级分类,但是MYSQL这里却不能很好的处理这个v_category_inner_code作为条件又给它赋值的操作,语法是没错误的,但是结果就是不出来,运行时还提示的结果超过多行错误!<br /></strong></p>
mysql 存储过程 在线急求解答!!!
BEGIN /*起始时间|上车时间*/ DECLARE startime varchar(20); /*结束时间|下车时间*/ DECLARE endtime varchar(20) ; /*上车站号*/ DECLARE upnum int(11) ; /*循环判断条件*/ DECLARE b varchar(10); /*避免死循环,设置循环次数*/ DECLARE i int(11) ; /*当前站号*/ DECLARE starnum int(11); /*下一站站号*/ DECLARE endnum int(11); /*最大站号*/ DECLARE maxnum int(11); /*判断站号顺序*/ DECLARE checknum varchar(20); /*统计人数*/ DECLARE peopels int(11); /*上车人数*/ DECLARE uppeople int(11); /*下车人数*/ DECLARE getpeople int(11); /*临时变量*/ DECLARE num int(11); DECLARE num1 int(11); DECLARE num2 int(11); DECLARE num3 int(11); DECLARE drivernum int(11) ; DECLARE drivermax int(11) ; DECLARE driverone varchar(20) ; DECLARE uptime varchar(20) ; DECLARE gettime varchar(20) ; DECLARE onepickUpVehicle varchar(20) ; DECLARE onecarUpnum int(11); DECLARE onetransactionType varchar(20); DECLARE onetransactionDate varchar(20); set names utf8; set onepickUpVehicle = '京AG7614'; set onetransactionType = '一般消费'; set onetransactionDate = '20131015'; CREATE TEMPORARY TABLE IF NOT EXISTS carpeople ( pickUpVehicle varchar(20) not null, pickUpTime varchar(20) not null, pickUpStationNum int(11) not null, peoplenum int(11) not null ); CREATE TEMPORARY TABLE IF NOT EXISTS carerror ( pickUpVehicle varchar(20) not null, pickUpTime varchar(20) not null, pickUpStationNum int(11) not null, peoplenum int(11) not null ); CREATE TEMPORARY TABLE IF NOT EXISTS onetime ( id int(11) not null AUTO_INCREMENT, pickUpTime varchar(20) not null, gettime varchar(20) not null, lorr varchar(20) not null, PRIMARY KEY (`id`) ); CREATE TEMPORARY TABLE IF NOT EXISTS oneday ( driver varchar(8) not null, pickUpTime varchar(20) not null, pickUpVehicle varchar(20) not null, pickUpStationNum int(11) not null, getOffStationNum int(11) not null , revenueAmount float(5) not null ); CREATE TEMPORARY TABLE IF NOT EXISTS onedriver ( driver varchar(20) ); CREATE TEMPORARY TABLE IF NOT EXISTS onecarUp( driver varchar(8) not null, pickUpTime varchar(20) not null, pickUpVehicle varchar(20) not null, pickUpStationNum int(11) not null, getOffStationNum int(11) not null, revenueAmount float(5) not null ); CREATE TEMPORARY TABLE IF NOT EXISTS people( id int(11) not null , pickUpTime varchar(20) not null, getOffTime varchar(20) not null, starnum int(11) not null ); insert into oneday ( select pgtraffic.card.driver,pgtraffic.card.pickUpTime,pgtraffic.card.pickUpVehicle,pgtraffic.card.pickUpStationNum,pgtraffic.card.getOffStationNum,pgtraffic.card.revenueAmount from pgtraffic.card where pgtraffic.card.transactionDate='20131015' order by pgtraffic.card.pickUpTime ); insert into onecarUp ( select o.driver,o.pickUpTime,o.pickUpVehicle,o.pickUpStationNum,o.getOffStationNum,o.revenueAmount from oneday as o where o.pickUpVehicle=onepickUpVehicle ); insert into onedriver ( select o.driver from onecarUp as o group by o.driver ); set drivermax = (select count(o.driver) from onedriver as o); set drivernum = 1; WHILE drivernum <= drivermax DO set driverone = (select o.driver from onedriver as o limit 0,1); set onecarUpnum = ( select count(o.getOffStationNum) from onecarUp as o where o.revenueAmount != 1 and o.driver = driverone and o.pickUpStationNum != o.getOffStationNum ); if onecarUpnum is not null then /*获取最大站号*/ set maxnum = (select o.pickUpStationNum from onecarUp as o order by o.pickUpStationNum desc limit 0,1); set num = (select o.getOffStationNum from onecarUp as o order by o.getOffStationNum desc limit 0,1); if num > maxnum then set maxnum = num; end if; set startime = (select o.pickUpTime from onecarUp as o limit 0,1); set b = 't'; set i = 1; WHILE b = 't' DO CREATE TEMPORARY TABLE IF NOT EXISTS onecarNum( pickUpTime varchar(20) not null, pickUpVehicle varchar(20) not null, pickUpStationNum int(11) not null, getOffStationNum int(11) not null ); insert into onecarNum ( select o.pickUpTime,o.pickUpVehicle,o.pickUpStationNum,o.getOffStationNum from onecarUp as o where o.pickUpTime >= startime ); set upnum = (select o.pickUpStationNum from onecarNum as o limit 0,1); set endtime = (select o.pickUpTime from onecarNum as o where o.pickUpStationNum != upnum limit 0,1); set num = (select count(o.pickUpStationNum) from onecarNum as o where o.pickUpTime = endtime and o.pickUpStationNum = upnum); if num is not null and num > 0 then set num1 = (select count(o.pickUpStationNum) from onecarNum as o where o.pickUpTime = endtime and o.pickUpStationNum = upnum group by o.pickUpStationNum order by o.pickUpStationNum limit 0,1); set num2 = (select count(o.pickUpStationNum) from onecarNum as o where o.pickUpTime = endtime and o.pickUpStationNum != upnum group by o.pickUpStationNum order by o.pickUpStationNum desc limit 0,1); if num1 >= num2 then set endtime = (select o.pickUpTime from onecarNum as o where o.pickUpStationNum != upnum and o.pickUpTime > endtime limit 0,1); end if; end if; if endtime is null then set endtime = (select ou.pickUpTime from onecarUp as ou order by ou.pickUpTime desc limit 0,1); set b = 'f'; insert into people ( select i,startime,endtime,o.pickUpStationNum from onecarNum as o group by o.pickUpStationNum ); end if; if endtime is not null then set num1 = (select o.getOffStationNum from onecarNum as o where o.pickUpTime < endtime and o.pickUpTime >= startime order by o.getOffStationNum limit 0,1); set num2 = (select o.getOffStationNum from onecarNum as o where o.pickUpTime < endtime and o.pickUpTime >= startime order by o.getOffStationNum desc limit 0,1); if (upnum > num1 and upnum > num2) or (upnum < num1 and upnum < num2) then insert into people ( select i,startime,endtime,o.pickUpStationNum from onecarNum as o where o.pickUpTime < endtime and o.pickUpTime >= startime and o.pickUpStationNum = upnum group by o.pickUpStationNum ); end if; if !((upnum > num1 and upnum > num2) or (upnum < num1 and upnum < num2)) then CREATE TEMPORARY TABLE IF NOT EXISTS tem ( id int(1) not null AUTO_INCREMENT, pickUpTime varchar(20) , pickUpVehicle varchar(20) , pickUpStationNum int(11) , getOffStationNum int(11) , PRIMARY KEY (`id`) ); insert into tem (select null,o.pickUpTime,o.pickUpVehicle,o.pickUpStationNum,o.getOffStationNum from onecarNum as o where o.pickUpTime < endtime and o.pickUpTime >= startime and o.pickUpStationNum = upnum); set num1 = (select t.id from tem as t order by t.id desc limit 0,1); set num2 = 1; set checknum = null; WHILE num2 <= num1 DO set num3 = (select t.getOffStationNum from tem as t where t.id = num2 order by t.pickUpTime ); if checknum is null then if num3 < upnum then set checknum = 'l'; end if; if num3 > upnum then set checknum = 'r'; end if; end if; if checknum is not null then if num3 < upnum then if checknum != 'l' then set uptime = (select t.pickUpTime from tem as t where t.id = num2 order by t.pickUpTime ); insert into people ( select i,startime,uptime,o.pickUpStationNum from onecarNum as o where o.pickUpTime < uptime and o.pickUpTime >= startime and o.pickUpStationNum = upnum group by o.pickUpStationNum ); set startime = uptime; end if; end if; if num3 > upnum then if checknum != 'r' then set uptime = (select t.pickUpTime from tem as t where t.id = num2 order by t.pickUpTime ); insert into people ( select i,startime,uptime,o.pickUpStationNum from onecarNum as o where o.pickUpTime < uptime and o.pickUpTime >= startime and o.pickUpStationNum = upnum group by o.pickUpStationNum ); set startime = uptime; end if; end if; end if; END WHILE; insert into people ( select i,startime,endtime,o.pickUpStationNum from onecarNum as o where o.pickUpTime < endtime and o.pickUpTime >= startime and o.pickUpStationNum = upnum group by o.pickUpStationNum ); DROP TABLE tem; end if; end if; if i = 100 then insert into carerror (pickUpVehicle, pickUpTime, pickUpStationNum, peoplenum) values ( onepickUpVehicle , '数据有问题',0,0); select * from carerror; set b = 'f'; end if; set upnum = null; set startime = endtime; set endtime = ''; DROP TABLE onecarNum; set i = i + 1; END WHILE; set num = (select count(p.starnum) from people as p); set i = 1; set checknum = null; set startime = (select p.pickUpTime from people as p where p.id = i ); WHILE i < num DO set starnum = (select p.starnum from people as p where p.id = i ); set endnum = (select p.starnum from people as p where p.id = (i + 1) ); if starnum > endnum then if checknum is null then set checknum = 'r'; end if; if checknum != 'r' then set uptime = (select p.pickUpTime from people as p where p.id = i ); set gettime = (select p.getOffTime from people as p where p.id = i ); if uptime = gettime then set upnum = (select o.getOffStationNum from onecarUp as o where o.pickUpTime = uptime limit 0,1); end if; if uptime != gettime then set upnum = (select o.getOffStationNum from onecarUp as o where o.pickUpTime >= uptime and o.pickUpTime < gettime limit 0,1); end if; if upnum > starnum then set endtime = (select p.getOffTime from people as p where p.id = i ); insert into onetime(pickUpTime, gettime, lorr) values (startime, endtime, checknum ); set startime = endtime; end if; if upnum < starnum then set endtime = (select p.pickUpTime from people as p where p.id = i ); insert into onetime(pickUpTime, gettime, lorr) values (startime, endtime, checknum ); set startime = endtime; end if; set checknum = null; end if; end if; if starnum < endnum then if checknum is null then set checknum = 'l'; end if; if checknum != 'l' then set uptime = (select p.pickUpTime from people as p where p.id = i ); set gettime = (select p.getOffTime from people as p where p.id = i ); if uptime = gettime then set upnum = (select o.getOffStationNum from onecarUp as o where o.pickUpTime = uptime limit 0,1); end if; if uptime != gettime then set upnum = (select o.getOffStationNum from onecarUp as o where o.pickUpTime >= uptime and o.pickUpTime < gettime limit 0,1); end if; if upnum > starnum then set endtime = (select p.pickUpTime from people as p where p.id = i ); insert into onetime(pickUpTime, gettime, lorr) values (startime, endtime, checknum ); set startime = endtime; end if; if upnum < starnum then set endtime = (select p.getOffTime from people as p where p.id = i ); insert into onetime(pickUpTime, gettime, lorr) values (startime, endtime, checknum ); set startime = endtime; end if; set checknum = null; end if; end if; if starnum = endnum then set endtime = (select p.getOffTime from people as p where p.id = i ); insert into onetime(pickUpTime, gettime, lorr) values (startime, endtime, checknum ); set startime = (select p.pickUpTime from people as p where p.id = (i + 1) ); set checknum = null; end if; set i = i + 1; END WHILE; set endtime = (select p.getOffTime from people as p where p.id = i ); insert into onetime (pickUpTime, gettime, lorr) values (startime, endtime, checknum ); set num = (select o.id from onetime as o order by o.id desc limit 0,1); set num1 = (select count(*) from onetime as o group by o.lorr order by o.lorr limit 0,1); set num2 = (select count(*) from onetime as o group by o.lorr order by o.lorr desc limit 0,1); if num1 is not null and num1 > 0 and num2 is not null and num2 > 0 then if num1 - num2 > 1 or num1 - num2 < -1 then insert into carerror (pickUpVehicle, pickUpTime, pickUpStationNum, peoplenum) values ( onepickUpVehicle , '数据有问题',0,0); select * from carerror; end if; end if; set i = 1; WHILE i <= num DO CREATE TEMPORARY TABLE IF NOT EXISTS upcar( starnum int(11) not null, peoplenum int(11) not null ); CREATE TEMPORARY TABLE IF NOT EXISTS getcar( starnum int(11) not null, peoplenum int(11) not null ); set startime = (select o.pickUpTime from onetime as o where o.id = i ); set endtime = (select o.gettime from onetime as o where o.id = i ); if startime = endtime then insert into upcar( select o.pickUpStationNum,count(o.pickUpTime) from onecarUp as o where o.pickUpTime = startime group by o.pickUpStationNum ); insert into getcar( select o.getOffStationNum,count(o.pickUpTime) from onecarUp as o where o.pickUpTime = startime group by o.getOffStationNum ); end if; if startime != endtime then if i = num then insert into upcar( select o.pickUpStationNum,count(o.pickUpTime) from onecarUp as o where o.pickUpTime <= endtime and o.pickUpTime >= startime group by o.pickUpStationNum ); insert into getcar( select o.getOffStationNum,count(o.pickUpTime) from onecarUp as o where o.pickUpTime <= endtime and o.pickUpTime >= startime group by o.getOffStationNum ); end if; if i != num then insert into upcar( select o.pickUpStationNum,count(o.pickUpTime) from onecarUp as o where o.pickUpTime < endtime and o.pickUpTime >= startime group by o.pickUpStationNum ); insert into getcar( select o.getOffStationNum,count(o.pickUpTime) from onecarUp as o where o.pickUpTime < endtime and o.pickUpTime >= startime group by o.getOffStationNum ); end if; end if; set peopels = 0; set b = (select o.lorr from onetime as o where o.id = i ); if b = 'l' then set num1 = 1; WHILE num1 <= maxnum DO set uppeople = (select u.peoplenum from upcar as u where u.starnum = num1); set getpeople = (select u.peoplenum from getcar as u where u.starnum = num1); if uppeople is null then set uppeople = 0; end if; if getpeople is null then set getpeople = 0; end if; set peopels = peopels + uppeople - getpeople; insert into carpeople (pickUpVehicle, pickUpTime, pickUpStationNum, peoplenum) values ( onepickUpVehicle,onetransactionDate,num1,peopels); set num1 = num1 + 1; END WHILE; end if; if b = 'r' then set num1 = maxnum; WHILE num1 >= 1 DO set uppeople = (select u.peoplenum from upcar as u where u.starnum = num1); set getpeople = (select u.peoplenum from getcar as u where u.starnum = num1); if uppeople is null then set uppeople = 0; end if; if getpeople is null then set getpeople = 0; end if; set peopels = peopels + uppeople - getpeople; insert into carpeople (pickUpVehicle, pickUpTime, pickUpStationNum, peoplenum) values ( onepickUpVehicle,onetransactionDate,num1,peopels); set num1 = num1 - 1; END WHILE; end if; DROP TABLE upcar; DROP TABLE getcar; set i = i + 1; END WHILE; /* select num; select maxnum; select * from onecarUp; select * from people; select * from onetime; select * from oneday as o where o.pickUpVehicle='京AK9706'; */ end if; delete from onedriver where onedriver.driver = driverone; set drivernum = drivernum + 1; END WHILE; select * from carpeople; DROP TABLE onecarUp; DROP TABLE oneday; DROP TABLE people; DROP TABLE onetime; DROP TABLE carpeople; DROP TABLE carerror; DROP TABLE onedriver; END 这是我写的存储过程, set onepickUpVehicle = '京AG7614' 的时候就会报错 ERROR 1242 (21000): Subquery returns more than 1 row 但是当 set onepickUpVehicle = '京AD4977' 就没有问题,程序能正常执行。 这是为什么???
MYSQL存储过程SELECT下面不执行
BEGIN DECLARE i INT(8) DEFAULT 2; DECLARE j INT(8) DEFAULT 0; DECLARE c VARCHAR(15); DECLARE s VARCHAR(15); DECLARE t VARCHAR(15); SET j=LENGTH(id)-LENGTH(REPLACE(id,',','')); WHILE i<=j DO SET c=SUBSTRING_INDEX(SUBSTRING_INDEX(id,',',i),',',-1); SET s=SUBSTRING_INDEX(SUBSTRING_INDEX(type,',',i),',',-1); SET t=SUBSTRING_INDEX(SUBSTRING_INDEX(sta,',',i),',',-1); SELECT p.*,c,s,t,i FROM praise p WHERE pId=c AND pType=s AND pStatue=t; SET i=i+1; END WHILE; END 代码如上,为什么SELECT后面的语句都不执行了,只要执行了一次SELECT语句,后面的就都不执行了! 弄得我一脸懵比,比如I从1开始 J=4,当I=1时,SELECT语句执行了一次,然后循环就断掉了。我的语句哪不对啊。。。
mysql存储过程游标遍历表数据报错,1328 Incorrect number of FETCH variables
下面是整个存储过程,我自己查了数量一致类型一致,就是不知道它为什么报这个错误,还是说我写的这个游标有问题? ``` DELIMITER $$ DROP PROCEDURE IF EXISTS `PRODUCTINVENTORY_SYNC` $$ CREATE PROCEDURE PRODUCTINVENTORY_SYNC() BEGIN DECLARE tmpId INT(11); DECLARE storeCode VARCHAR(50); -- 仓库编码 DECLARE storeName VARCHAR(80); -- 仓库名称 DECLARE productCode VARCHAR(60); -- 商品编码 DECLARE productSubno VARCHAR(40); -- 商品条码 DECLARE productName VARCHAR(80); -- 商品名称 DECLARE supplierCode VARCHAR(60); -- 供应商编码 DECLARE supplierName VARCHAR(80); -- 供应商名称 DECLARE productTypeCode VARCHAR(40); -- 商品类型编码 DECLARE productTypeName VARCHAR(80); -- 商品类型名称 DECLARE productBrandCode VARCHAR(60); -- 商品品牌编码 DECLARE productBrandName VARCHAR(80); -- 商品品牌名称 DECLARE purchasePrice DECIMAL(10,2); -- 进货价 DECLARE retailPrice DECIMAL(10,2); -- 零售价 DECLARE memberPrice DECIMAL(10,2); -- 会员价 DECLARE productStock INT(11); -- 商品库存 DECLARE c_count INT; -- 遍历数据结束标志 DECLARE done INT DEFAULT FALSE; -- 设置游标 DECLARE cur_productInventorys CURSOR FOR SELECT tmp_id store_code, store_name, product_code, product_subno, product_name, supplier_code, supplier_name, product_type_code, product_type_name, product_brand_code, product_brand_name, purchase_price, retail_price, member_price, product_stock FROM product_inventory_tmp_t t WHERE t.processingStatus = 2; -- 将结束标志绑定到游标 DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; DELETE it FROM product_inventory_t it WHERE NOT EXISTS (SELECT 1 FROM product_inventory_tmp_t pt WHERE it.product_code = pt.product_code AND it.product_subno = pt.product_subno and it.store_code = pt.store_code AND pt.processingStatus = 2); -- 打开游标 OPEN cur_productInventorys; -- 遍历 read_loop: LOOP -- 设置给对应字段 FETCH cur_productInventorys INTO tmpId,storeCode,storeName,productCode,productSubno,productName,supplierCode,supplierName,productTypeCode,productTypeName,productBrandCode,productBrandName,purchasePrice,retailPrice,memberPrice,productStock; IF done THEN -- 判断是否继续循环 LEAVE read_loop; -- 结束循环 END IF; SELECT count(1) INTO c_count FROM product_inventory_t pit WHERE pit.product_code = productCode AND pit.product_subno = productSubno AND pit.store_code = storeCode; IF c_count = 0 THEN INSERT INTO product_inventory_t ( `store_code`, `store_name`, `product_code`, `product_subno`, `product_name`, `supplier_code`, `supplier_name`, `product_type_code`, `product_type_name`, `product_brand_code`, `product_brand_name`, `purchase_price`, `retail_price`, `member_price`, `product_stock`, `create_time`, `update_time` ) VALUES ( storeCode, storeName, productCode, productSubno, productName, supplierCode, supplierName, productTypeCode, productTypeName, productBrandCode, productBrandName, purchasePrice, retailPrice, memberPrice, productStock, `new()`, `new()`); ELSE UPDATE product_inventory_t SET `store_code`= storeCode, `store_name` = storeName, `product_code` = productCode, `product_subno` = productSubno, `product_name` = productName, `supplier_code` = supplierCode, `supplier_name` = supplierName, `product_type_code` = productTypeCode, `product_type_name` = productTypeName, `product_brand_code` = productBrandCode, `product_brand_name` = productBrandName, `purchase_price` = purchasePrice, `retail_price` = retailPrice, `member_price` = memberPrice, `product_stock` = productStock, `update_time` = now() WHERE product_code = productCode AND product_subno = productSubno AND store_code = storeCode; END IF; UPDATE product_inventory_tmp_t SET `processingStatus` = 4 where tmp_id = tmpId; END LOOP read_loop; -- 关闭游标 CLOSE cur_productInventorys; DELETE FROM product_inventory_tmp_t WHERE `processingStatus` = 4; END $$ DELIMITER ```
mysql编程,如何存储多个查询结果
大家好,我的需求是这样的,在写mysql存储过程的时候, 在循环游标中的数据时,根据数据会继续查询相关记录 #开始获取游标的值 FETCH root_knowledge_cursor INTO _knowledge_id,_knowledge_code; #此处查到的记录会是多条!我可以采用什么样的数据类型来存储这多条记录的结果(_childKids)?并将该结果进行遍历,依次存储到另一张表中?这就是我的问题 SELECT knowledge_id INTO _childKids FROM edu_knowledge k WHERE k.`knowledge_code` LIKE CONCAT(_knowledge_code,'%'); IF _childKids IS NOT NULL THEN #此处希望可以循环 _childKids ,依次向表插入记录 INSERT INTO a(rootKid,childKid) VALUES (_knowledge_id,_childKid); #_childKid为遍历_childKids 时取得的值 END IF; UNTIL flag END REPEAT; CLOSE root_knowledge_cursor; 如果有表达不清楚的地方,还请大家指正! 没有C币悬赏不了,还请见谅!
Mysql5.7.18 存储过程跨日处理 求助!
1、需求:(周四、周五)凌晨处理3天前数据,(周一、周二、周三)凌晨处理5天前数据,周六周日不处理; 2、请问如何修改下列存储过程? ``` /* Mysql5.7.18 */ CREATE PROCEDURE increase_available() p: begin -- 开始存储过程 declare current_product_code varchar(32); -- 产品代码 declare current_userid INT(11); -- 用户ID declare current_verify_time INT(11); -- 审核时间 declare current_amount INT(11); -- 交易数量 declare handle_day INT(11); -- 处理日 declare handle_day_before INT(11); -- 处理日(前一天) -- 交易审核的起始时间:三天前 -- start_date = unix_timestamp(DATE_ADD(date(CURDATE()),INTERVAL -3 DAY)); -- 交易审核的结束时间:二天前 -- end_date = unix_timestamp(DATE_ADD(date(CURDATE()),INTERVAL -2 DAY)); DECLARE done INT DEFAULT FALSE; -- 自定义控制游标循环,默认false -- 按T+3日处理,周六、周日不处理。 -- 当前周四处理周一的数据, if DAYOFWEEK(CURDATE()) = 5 then set @handle_day = 3, @handle_day_before = 2; -- 当前周五处理周二的数据 elseif DAYOFWEEK(CURDATE()) = 6 then set @handle_day = 3, @handle_day_before = 2; -- 当前下周一处理上周三的数据 elseif DAYOFWEEK(CURDATE()) = 2 then set @handle_day = 5, @handle_day_before = 4; -- 当前下周二处理上周四的数据 elseif DAYOFWEEK(CURDATE()) = 3 then set @handle_day = 5, @handle_day_before = 4; -- 当前下周三处理上周五的数据 elseif DAYOFWEEK(CURDATE()) = 4 then set @handle_day = 5, @handle_day_before = 4; else -- 周六、周日不处理,不执行存储过程 LEAVE p; end if; DECLARE My_Cursor CURSOR FOR ( SELECT product_code, userid, amount, verify_time FROM oa_option_transactions WHERE type= 1 and `status`=2 and verify_time >= unix_timestamp(DATE_ADD(date(CURDATE()),INTERVAL - @handle_day DAY)) and verify_time < unix_timestamp(DATE_ADD(date(CURDATE()),INTERVAL - @handle_day_before DAY)) ); -- 定义游标并输入结果集 DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; -- 绑定控制到游标,游标循环结束自动转true OPEN My_Cursor; -- 打开游标 myLoop: LOOP -- 开始循环体,myLoop为自定义循环名,结束循环时用到 FETCH My_Cursor into current_product_code, current_userid, ,current_amount, current_verify_time; -- 将游标当前读取行的数据顺序赋予自定义 IF done THEN -- 判断是否继续循环 LEAVE myLoop; -- 结束循环 END IF; -- 自己要做的事情,在 sql 中直接使用自定义即可 UPDATE oa_option_holdings SET available = available + current_amount WHERE product_code = current_product_code and user_id = current_userid; -- COMMIT; -- 提交事务 END LOOP myLoop; -- 结束自定义循环体 CLOSE My_Cursor; -- 关闭游标 END ```
mysql 批量更新怎么写
MYSQL更新查询前100条数据的aaa字段为AAA,可以有一条sql写完吗,还是要写存储过程循环这一千条数据。 我只知道 select * from table1 where 1=1 limit 10 查前十条 那怎么批量更新呢
MYSQL游标REPEAT循环后,无法得到字符串返回值。望指教,谢谢!
我有一个数据表zq +-------+--------+--------------+---------+---------+--------+---------+ | zq_id | zq_dm | zq_mc | zqlx_id | fllx_id | jys_id | zq_cxhq | +-------+--------+--------------+---------+---------+--------+---------+ | 1 | 000001 | 平安银行 | 4 | 9 | 1 | 1 | | 2 | 113001 | 中行转债 | 4 | 9 | 1 | 1 | | 3 | 113005 | 平安转债 | 4 | 9 | 1 | 1 | | 4 | 131800 | R-003 | 3 | 5 | 2 | 0 | | 5 | 131801 | R-007 | 3 | 7 | 2 | 0 | | 6 | 131802 | R-014 | 3 | 8 | 2 | 0 | | 7 | 131809 | R-004 | 3 | 6 | 2 | 0 | | 8 | 131810 | R-001 | 3 | 3 | 2 | 1 | | 9 | 131811 | R-002 | 3 | 4 | 2 | 0 | | 10 | 150124 | 建信50B | 5 | 10 | 2 | 0 | | 11 | 510300 | 300ETF | 2 | 2 | 1 | 0 | | 12 | 600893 | 航空动力 | 1 | 1 | 1 | 0 | | 13 | 601318 | 中国平安 | 1 | 1 | 1 | 1 | | 14 | 601872 | 招商轮船 | 1 | 1 | 1 | 1 | +-------+--------+--------------+---------+---------+--------+---------+ 还有一个数据表jys +--------+--------+-----------------------+ | jys_id | jys_dm | jys_mc | +--------+--------+-----------------------+ | 1 | SH | 上海证券交易所 | | 2 | SZ | 深圳证券交易所 | +--------+--------+-----------------------+ 我想将表zq中字段zq_cxhq为1的记录的zq_dm字段和对应的jys_dm提取出来组成字符串,所期望的结果应该是得到字符串"SH000001,SH113001,SH113005,SZ131810,SH601318,SH601872,"。 我的方法是: CREATE DEFINER=`root`@`localhost` PROCEDURE `routine_Sshq`( OUT jyszqdm VARCHAR(100) ) BEGIN DECLARE zqdm VARCHAR(45); DECLARE jysdm VARCHAR(45); DECLARE jyszq VARCHAR(100); DECLARE done TINYINT(1) DEFAULT 0; DECLARE cur_zqhq CURSOR FOR SELECT zq_dm, jys_dm FROM zq LEFT JOIN jys ON jys.jys_id = zq.jys_id WHERE zq_cxhq = 1; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; OPEN cur_zqhq; REPEAT FETCH cur_zqhq INTO zqdm, jysdm; IF done = 0 THEN SET jyszq = CONCAT(jyszq, jysdm, zqdm, ','); END IF; UNTIL done = 1 END REPEAT; SET jyszqdm = jyszq; END 在DELPHI XE2中,我将这个存储过程的返回值,赋值给Edit控件,但始终无法成功。 我将这个存储过程的最后一行改为: SET jyszqdm = 'abc'; 同样无法成功。 我怀疑是不是前面那个REPEAT循环没有结束?但又找不到原因。 本人是自学菜鸟,期望哪位前辈高手指教。万分感谢。
在中国程序员是青春饭吗?
今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
python爬取百部电影数据,我分析出了一个残酷的真相
2019年就这么匆匆过去了,就在前几天国家电影局发布了2019年中国电影市场数据,数据显示去年总票房为642.66亿元,同比增长5.4%;国产电影总票房411.75亿元,同比增长8.65%,市场占比 64.07%;城市院线观影人次17.27亿,同比增长0.64%。 看上去似乎是一片大好对不对?不过作为一名严谨求实的数据分析师,我从官方数据中看出了一点端倪:国产票房增幅都已经高达8.65%了,为什...
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
C语言荣获2019年度最佳编程语言
关注、星标公众号,不错过精彩内容作者:黄工公众号:strongerHuang近日,TIOBE官方发布了2020年1月编程语言排行榜单。我在前面给过一篇文章《2019年11月C语言接近Ja...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
一份王者荣耀的英雄数据报告
咪哥杂谈本篇阅读时间约为 6 分钟。1前言前一阵写了关于王者的一些系列文章,从数据的获取到数据清洗,数据落地,都是为了本篇的铺垫。今天来实现一下,看看不同维度得到的结论。2环境准备本次实...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
一个程序在计算机中是如何运行的?超级干货!!!
强烈声明:本文很干,请自备茶水!???? 开门见山,咱不说废话! 你有没有想过,你写的程序,是如何在计算机中运行的吗?比如我们搞Java的,肯定写过这段代码 public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } ...
【蘑菇街技术部年会】程序员与女神共舞,鼻血再次没止住。(文末内推)
蘑菇街技术部的年会,别开生面,一样全是美女。
那个在阿里养猪的工程师,5年了……
简介: 在阿里,走过1825天,没有趴下,依旧斗志满满,被称为“五年陈”。他们会被授予一枚戒指,过程就叫做“授戒仪式”。今天,咱们听听阿里的那些“五年陈”们的故事。 下一个五年,猪圈见! 我就是那个在养猪场里敲代码的工程师,一年多前我和20位工程师去了四川的猪场,出发前总架构师慷慨激昂的说:同学们,中国的养猪产业将因为我们而改变。但到了猪场,发现根本不是那么回事:要个WIFI,没有;...
为什么程序猿都不愿意去外包?
分享外包的组织架构,盈利模式,亲身经历,以及根据一些外包朋友的反馈,写了这篇文章 ,希望对正在找工作的老铁有所帮助
Java校招入职华为,半年后我跑路了
何来 我,一个双非本科弟弟,有幸在 19 届的秋招中得到前东家华为(以下简称 hw)的赏识,当时秋招签订就业协议,说是入了某 java bg,之后一系列组织架构调整原因等等让人无法理解的神操作,最终毕业前夕,被通知调往其他 bg 做嵌入式开发(纯 C 语言)。 由于已至于校招末尾,之前拿到的其他 offer 又无法再收回,一时感到无力回天,只得默默接受。 毕业后,直接入职开始了嵌入式苦旅,由于从未...
立即提问