#mysql - Mon 26 Mar 2007 between 00:00 and 00:28

NY Lost Funds



XgcCaT[tm]: SELECT v1.*, v1.m2-v1.m3 AS mdiff FROM (SELECT col1, MAX(col2) AS m2, MAX(col3) AS m3 FROM tbl GROUP BY col1) AS v1;
CaT[tm]ah.
xgc: I figured that'd be where you'd be heading
Zyconwhen your doing a join is it possible to limit the joinb to only connect to a single matching row?
i.e. left join myothertable on bla = bla limit 1?
thekazquestion, in windows i can not get phpbb to recongnize that i have mysql server installed
how do i get it to recongnize it
chadmaynardZycon: a left join?
ZyconTable A has a one to many relationship with table B, I want to join table A to table B with some criteria, but i only want to join with the first row
so that if i go A left join B where a.id = 5, I only ever get 1 result returned
thekazanyone?>
CaT[tm]hmmm. how could I get a rolling sum of a column? is there a function that I can use? adding with rollup to groupby doesn't quite produce the right result.
chadmaynardthekaz: have you installed the php-mysql connector?
thekazno never heard of it
wher can i get that? the mysql homepage
kimseongCaT[tm]: maybe user variable
CaT[tm]: do you mean accumulated sum?
CaT[tm]ie sum of the values of clomun blah up until this row, then the next row and the next etc.
kimseongCaT[tm]: set @s:=0; select v,@s:=@s+v ....
CaT[tm]doesn't seem to update @s.
Zyconhttp://pastie.caboo.se/49488.txt << tbl_job_history has a one to many relationship with tbl_job.. i need to restrict the join so that only a signle row row is joined between history a job if it has a status of 14(i.e. i only want to know if there is some history item with stat_id = 14 for this job)
I can't use a group by like i'd normally do, because it will mess up the sum
Chaotic_Dis there any reason to want a foreign key to be based on anything like a combination of other fields? or is it enough that it's a unique number?
kimseongCaT[tm]: ?
CaT[tm]kimseong: it gives the same value as the column I'm trying to add to the @s
kimseongCaT[tm]: for all rows?
CaT[tm]: @s := @s + v
CaT[tm]yeah. so if Im doing @total := @total + gain, it always gives back gain
kimseongweird, try @total := (@total + gain)
CaT[tm]: the set @total:=0 is outside the select
CaT[tm]yeah. it is. and I'm using the bracketed version.
thekazquestion, in windows i can not get phpbb to recongnize that i have mysql server installed
how do i get it to recongnize it
i have the php-mysql connector installed also
thumbsyou compile install php with mysql support
CaT[tm]ah. it doesn't like the things I'm adding. grr.
kimseongthekaz: check with phpinfo() alreasy
CaT[tm]it works if I just add 1
kimseongCaT[tm]: can i see the whole statement
CaT[tm]it's a bit big. I think I need to do a subselect as it doesn't deal well with max() in the math

Page: 2 9 16 23 30 37 44 51 58 65 72 

IrcArchive

NY Lost Funds