#mysql
09 November 2007
Total 27 pages. You are browsing page 2/27.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
00:42 <****> is there a place where i can paste my code
00:42 <****> rafb.net/paste
00:43 <****> http://pastebin.ca/
00:45 <****> 127.0.0.1 forces tcp/ip. excellent.
00:47 <****> stupid question how do i set a pass to my root user?
00:48 <****> !man set password syntax
00:48 <****> (SET PASSWORD Syntax) : http://dev.mysql.com/doc/mysql/en/set-password.html
00:48 <****> ty
00:48 <****> ok got it
00:48 <****> http://rafb.net/p/lUebTN73.html
00:48 <****> t1 has no records and t2 and 10 records
00:49 <****> has 10 records*
00:51 <****> yadayada: can you run one segment to see if the problem is your join instead of your math. say 'SELECT username, ifnull(SUM( amount ),0) AS amount FROM t2'
00:51 <****> what should i be looking for?
00:52 <****> if it returns a 0, instead of a null
00:53 <****> yadayada: sorry, trying to do 3 things at once and doing none of them well.
00:53 <****> heh its quite alright, i appreciate the help, take your time
00:55 <****> ki77a77, it returns a number when there is records, but not when there isnt
00:59 <****> hey all, i'm trying a simple join...
00:59 <****> http://phpfi.com/274819
00:59 <****> yadayada, does it return 0 when there is nothing in the table?
00:59 <****> nope
00:59 <****> i just want the 3 tournament names.... why am i getting 9 results
00:59 <****> thats the problem
01:00 <****> ahh. return null?
01:00 <****> yupp, but its a no record null, not a field null, so all my isnull and ifnull dont work
01:01 <****> interesting. let me do some digging. and look at your sql
01:01 <****> ok, thanks a lot kylej
01:02 <****> no problem.
01:14 <****> can i have logfiles per database or per user?
01:14 <****> yadayada: SELECT COALESCE(t2.amount) - COALESCE(t1.cost) AS total FROM ...
01:15 <****> yadayada: Ooops...
01:15 <****> yadayada: SELECT COALESCE(t2.amount,0) - COALESCE(t1.cost,0) AS total FROM ...
01:16 <****> yadayada: I suspect you'll find the IFNULL() calls unnecessary. But if you really have null amount and cost values, leave the calls in.
01:16 <****> Xgc: still not returning anything
01:17 <****> yadayada: Then your JOIN is not correct or finds no rows in t1.
01:17 <****> vizzy: you mean bin logs?
01:17 <****> ya, there are no rows in t1
01:17 <****> but i need to make it regardless
01:18 <****> yadayada: Did you post create table and insert statements to duplicate this test?
01:18 <****> if there are no rows, return zero
01:18 <****> yadayada: Not possible.
01:18 <****> mikegriffin_, i mean --log=.... startup option
01:18 <****> yadayada: Explain your real intent for me. I wasn't here earlier.
01:18 <****> ok
01:19 <****> i need to have two summed fields (from two different tables) subtract from eachother
01:19 <****> t2.amount - t1.amount
01:20 <****> yadayada: You need a full outer join.
01:20 <****> i have a left outer join
01:20 <****> http://rafb.net/p/lUebTN73.html
01:20 <****> vizzy: there is not really anything db or user specific in the logs
01:20 <****> yadayada: full outer join is not a left join.
01:20 <****> i guess if it crashes
01:21 <****> mikegriffin_, nothing but the query....
01:21 <****> haha, ok, is it just OUTER JOIN
01:21 <****> yadayada: Full outer join is the union of a left join and right join.
01:21 <****> ooh general log
01:21 <****> is it possible for me to just replace the LEFT OUTER JOIN
01:21 <****> mikegriffin_, so what i you want to watch a specific database log? or trace a users activity on mysql?
01:21 <****> yadayada: No. MySQL does not have a full outer join.
01:22 <****> oh.
01:22 <****> mikegriffin_, can't we do somthing like --log=/var/log/mysql-%DB%.log or %DB%-%USER%.log?
01:23 <****> yadayada: Just to be clear, are you saying sometimes t1 has no entry for a user and sometimes t2 has no entry for a user?
01:23 <****> sometimes they have no records
01:23 <****> Xgc: http://rafb.net/p/yMcFPd56.html
01:23 <****> yadayada: None at all, t1 and t2 are empty?
01:23 <****> i made t1 empty to simulate it
01:24 <****> yadayada: That's not my question.
01:24 <****> yadayada: Do you have a user table?
01:24 <****> Xgc, there is no way to get that code (which contains no records) to return a zero?
01:24 <****> yes i do have a user table
01:24 <****> yadayada: Follow me for a moment.
01:25 <****> yadayada: Then start with the user table and left join t1 and then left join t2.
01:25 <****> yadayada: Simple as that.
01:25 <****> how is that different from what i have
01:25 <****> if t1 doesnt have any records, then sum(t1.blah) will return nothing
01:25 <****> yadayada: it's different. Try it and then I'll explain if you dno't understand.
01:26 <****> yadayada: The main difference is usertable will always have an entry for any user you pick.
01:26 <****> ahh i understand
01:26 <****> nifty
01:27 <****> ok, here goes
01:27 <****> heh, beginner so im heading for the tuts
01:28 <****> vizzy: i dont see a way to do it realtime
01:28 <****> vizzy: you could easily do it after the fact
01:28 <****> ie parse the logs
01:28 <****> is there a mysql gui tool to manage databases and tables etc?
01:29 <****> mysql-query-browser
01:29 <****> phpMyAdmin
01:29 <****> mysql administrator
01:29 <****> phpmyadmin is popular
01:29 <****> hi, I read that when I use "alter table t enable keys", "repair by sorting" is faster than "repair with keycache"
01:29 <****> but what is "Repair w
01:29 <****> ith 12 threads"?
01:29 <****> yeah, i just don't want to install phpmyadmin on this server :/ and for being such a command line junkie, it get really frustrated managing databases from command line, i don't know why
01:30 <****> yadayada: http://rafb.net/p/kbaHfY77.html
01:30 <****> yadayada: Something like that.
01:30 <****> yadayada: Then add the coalesce() I showed you.
01:30 <****> pabst, http://dev.mysql.com/downloads/gui-tools/5.0.html
01:31 <****> yadayada: v
01:31 <****> yadayada: http://rafb.net/p/7pBtUM94.html
Total 27 pages. You are browsing page 2/27.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
