#mysql
17 October 2007
Total 30 pages. You are browsing page 1/30.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
--- Log opened Wed Oct 17 00:00:24 2007
00:07 <****> my brain is broken. I have a name and a number. I want to find any names which have more than one record *and* those records have different true/false values for the number. foo,0;foo,2; meet this criteria, but foo,2;foo,3; does not
00:08 <****>1;
00:08 <****> which gave me the opposite result
00:11 <****> mistake in my example: foo,0;foo,2; meet this criteria, but bar,2;bar,3; does not
00:15 <****> hi
00:16 <****> 12 AND WHERE Y < 8"?
00:17 <****> mcbane: you don't need the second where
00:18 <****> the AND makes it part of the same where clause
00:18 <****> 12 AND Y < 8"
00:18 <****> yes
00:18 <****> very nice
00:18 <****> Hi, I'm having a somewhat weird problem with an sql query - the following is returning no rows, and should be returning one. If I remove the 'AND `Comment`' part, it works fine. The `Comment` for this row is actually NULL. Any ideas?
00:18 <****> thank you dkr
00:18 <****> SELECT `Current Hostname`, `Customer`, `id`, `New Hostname`, `Serial No` FROM `Rollout07` WHERE (`Customer` = 'Sheppard, Jan' AND `Comment` != 'fish') ORDER BY `Customer`, `Serial No`;
00:19 <****> or comment is null
00:20 <****> dkr: so does NULL actually match all values at once?
00:20 <****> no. I'm confused
00:21 <****> dkr: same here. 'or comment is null' isn't a feasable solution for me, because it won't always be null for this query, only sometimes
00:21 <****> as far as I'm aware, my syntax is fine
00:22 <****> actually, I was correct. I made a test
00:22 <****> Eagleray: that's what "or" means, just sometimes. otherwise you'd use and
00:23 <****> dkr: lo yeah I understand that
00:23 <****> dkr: I just don't quite understand why '!= fish' doesn't match NULL
00:23 <****> dkr: (and you're right, adding an OR to my query will fix it)
00:23 <****> it means any value except fish. NULL is technically nto any value at all
00:24 <****> dkr: Interesting. I always thought that NULL should mean 'no value' rather than 'every value at once'
00:24 <****> no one said anything about 'every value at once'
00:24 <****> (aside from you, :)
00:25 <****> dkr: if NULL is _not_ every value at once, then why is it matching 'fish'?
00:25 <****> it's not
00:25 <****> dkr: last time I checked, 'fish' was definitely not the same thing as 'no value'
00:26 <****> comment 1= fish
00:26 <****> "comment != fish or comment is null" means either the value is something other than fish or it has no value
00:26 <****> dkr: if it's not matching 'fish', then why is my query returning no results when "AND != 'fish'" is part of the query?
00:27 <****> does != require a value in order to match?
00:27 <****> yes, that's why there are separate sql commands for matching NULL, like "is null"
00:27 <****> or "is not null"
00:27 <****> dkr: aha
00:27 <****> dkr: all suddenly becomes a lot clearer
00:28 <****> dkr: thanks very much for your help
00:29 <****> personally, I try to avoid avoid using NULL values in my fields at all. simplifies my code. :)
00:32 <****> dkr: same here, unfortunately it's not my database - it's someone else's, and it gets updated with a complete dump from a MS Access database nightly
00:32 <****> dkr: so NULL / NOT NULL is completely outside of my control
00:33 <****> dkr: I'm just responsible for the frontend
00:33 <****> sql puzzle of the day: http://dpaste.com/22374/
00:40 <****> fg3, are you talking about UNION ?
00:40 <****> gnari, thank you for reminding me -- this should work for OR, and AND conditions - so UNION will not work
00:40 <****> fg3: Query3 = Query1 UNION Query2
00:41 <****> fg3, what do you mean ?
00:41 <****> let me explain...
00:41 <****> ... or UNION ALL ...
00:42 <****> fg3: Before you explain anything keep it in mind gnari already provided you with the best solution :)
00:42 <****> salle, as he said query3 should get min 480 records, i expected he did not want duplicates
00:42 <****> gnari: Maybe.
00:42 <****> gnari: Maybe just duplicates don't make sense in this case
00:43 <****> Anyway ...
00:43 <****> I'll work on the explanation it should take me 5 minutes
00:43 <****> salle, but the AND comment destroyed all sense
00:43 <****> fg3: That was trivial one. What's your next question?
00:43 <****> back in 5
00:43 <****> hehe
00:44 <****> hi there
00:44 <****> fg3, if you have 2 queries returning identical columns, and you want a query that returns all rows that are returned by either query, then the UNION is what you want
00:45 <****> gnari: Lot of people get confused by the difference between english word "and" and boolean operator AND
00:45 <****> fg3, if you want all rows returned by query1+all rows returned by query2 , with possible duplicates, then UNION ALL is for you
00:45 <****> salle, true
00:46 <****> fg3, if you only want rows that are returned by both queries, you want INTERSECT
00:48 <****> hey can anyone tell me how to sort a mysql table based on data within a specific column?
00:48 <****>"
00:48 <****> is there any way to tell it to ascending or descending?
00:49 <****> adding option asc or desc i think
00:49 <****> not sure, new to mysql myself
00:49 <****> whitty: pulse00 is correct.
00:50 <****> whitty: ORDER BY f1 DESC, f2 ASC, f3 DESC;
00:50 <****> awesome, thanks for the help
00:50 <****> whitty: ASC is the default behavior if you don't specify it.
00:51 <****> fg3, i hope you realize your 2 queries are an abomination that should not be allowed to exist?
00:51 <****> Hi, had to restore /var and /etc on a server, now only root is able to logon to mysql - can anyone suggest where I look first?
00:52 <****> gnari, I'm happy you are here - sounds like you have much wisdom to share - I'm working on a better explanation of the situation - brb
00:58 <****> weedar: mysqladmin flush-privileges
00:58 <****> dkr: should that be necessary even after restart of mysql?
00:59 <****> The error on the users webpages is: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
01:00 <****> mysql.sock also exists, although it has a size of 0 :/
01:02 <****> I've also checked that the users databases exist and has content
01:02 <****> Basically, I'm stumped here :)
01:04 <****> weedar: Check permission in the file system related to that socket file.
01:04 <****> weedar: Error 13 is the hint.
01:05 <****> weedar: Root probably has access, yet other users probably don't.
01:05 <****> Xgc: owned by user mysql and group mysql, permissions 777
01:06 <****> weedar: I would guess that web application is not run as root or the mysql user.
01:07 <****> Xgc: should that even matter when permissions are 777 ?
01:07 <****> weedar: Did you check the directories as well?
01:07 <****> weedar: A user might not be able to drill down to see that file.
01:07 <****> anyone got any experience running ndb_restore after an unexpected power failure on all ndb nodes?
01:07 <****> fg3, be notified that i am leaving soon, so if you want to explain what a UNION is not what you want, then you better hurry
01:08 <****> gnari, almost done
01:08 <****> i'm trying to transform data i get from a 3-table join in a different way. kinda hard to explain so i describe it here: http://pastebin.ca/739206. Any help greatly appreciated, thanks
01:10 <****> i don't know if what i'm trying to do is possible from within the database, or i have to implement this in the code.
01:10 <****> gnari, mind if we chat here?
Total 30 pages. You are browsing page 1/30.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
