User talk:Kymara: Difference between revisions

Content deleted Content added
imported>Kymara
imported>Kymara
Line 196:
where event ='quest' and param1 = 'jenny_mill_flour' and param2 <> 'done' and timedate < '2010-11-24';
 
insert into temp_milled_flour
-- if they didn't pick it up then delete it - oh and they might pick it up between now and the next release too.
SELECT source, substring_index(param2,';',1) AS count, id AS gameEvents_id, timedate FROM gameEvents_2009_08_17
delete FROM stendhal.temp_milled_flour where (select id from gameEvents where event ='quest' and param1 =
WHERE event ='quest' AND param1 = 'jenny_mill_flour' AND param2 <> 'done' ;
'jenny_mill_flour' and param2 = 'done' and temp_milled_flour.source=gameEvents.source and gameEvents.id > gameEvents_id limit 1) is null;
 
insert into temp_milled_flour
SELECT source, substring_index(param2,';',1) AS count, id AS gameEvents_id, timedate FROM gameEvents_2009_02_19
WHERE event ='quest' AND param1 = 'jenny_mill_flour' AND param2 <> 'done' ;
 
insert into temp_milled_flour
SELECT source, substring_index(param2,';',1) AS count, id AS gameEvents_id, timedate FROM gameEvents_2008_08_21
WHERE event ='quest' AND param1 = 'jenny_mill_flour' AND param2 <> 'done' ;
 
-- yes I know about unions I just like to see row counts.
 
alter table temp_milled_flour
add index Index_tempflour_source(source);
 
alter table temp_milled_flour
add column last boolean default 0;
 
update temp_milled_flour t join
(select source, max(timedate) as maxdate from temp_milled_flour group by source) t2 on t.source = t2.source
set last = 1
where maxdate = timedate;
 
 
-- oh yes i remember now why i thought this was going to get hard - i can't use id like i planned.
select * from temp_milled_flour where last = 1 and timedate < '2009_08_17';
 
 
-- if they didn't pick it up then delete it - ohas andwhen they might pick it up betweenlater nowthey andwill get the next release too.points
-- oh and they might pick it up between now and the next release too :/
-- anyway it's only worth to check when it's the last mill they did
 
/* delete FROM stendhal.temp_milled_flour where last = 1 and (select id from gameEvents where event ='quest' and param1 =
'jenny_mill_flour' and param2 = 'done' and temp_milled_flour.source=gameEvents.source and gameEvents.id > gameEvents_id limit 1) is null; */
 
 
-- repeat? but checking the pickup gets harder.
</source>
 
Return to the user page of "Kymara".