#mysql
29 October 2007
Total 28 pages. You are browsing page 5/28.
First :: Prev :: [...] [3] [4] [5] [6] [7] [...] :: Next :: Last
01:33 <****> prakriti: or use something like 'NULLIF(column_name, '')'
01:33 <****> hey guys if i want to save an image data which type should i choose?
01:33 <****> coalesce is better
01:34 <****> jmoncayo: do you REALLY want to do that?
01:34 <****> chadmaynard: thanks a million. This has been pissing me off for a few days now. It looksl ike it's fixed now. Thanks again
01:34 <****> jmoncayo: look here: http://hashmysql.org/index.php?title=Storing_files_in_the_database
01:34 <****> i dont see how coalesce will help me
01:34 <****> jmoncayo: if you still want to know we shall help you
01:34 <****> jmoncayo: you generally want to let file systems manage files, and databases manage data.
01:34 <****> all I want are the ids of the rows that are the same exept for a couple values
01:34 <****> ok thanks
01:35 <****> i have a database schema question: I have product lines (think: "gold", "silver", "classic") each product line has a different set of categories ("gold" might have "desert", "dinner", "lunch" and "breakfast", whereas "classic" might only have "breakfast" and "lunch") so i have a categories/product_lines habtm relationship.
01:35 <****> so i need to compare them
01:35 <****> However, I want to link this information to a retailer. one retailer might have "gold" "lunch", "gold" "dinner" and "gold" "desert" and only "silver" "breakfast" whereas another retailer might have a different combination of these. How to make relations for these?
01:35 <****> and you are telling me that I CAN'T compare them because some are null.
01:36 <****> prakriti: compare COALESCE(column, 'Unknown') or similar
01:36 <****> so if i set them to an empty string, then I CAN compare them
01:36 <****> chadmaynard : but wont that be hefty on processing
01:36 <****> prakriti: that may be correct. change the schema then
01:36 <****> chadmaynard : and make my index useless?
01:36 <****> prakriti: no
01:37 <****> I should go.
01:38 <****> before prakriti tries to hurt me
01:38 <****> i need sleep
01:39 <****> How do I say create table if not exists?
01:39 <****> jsoftw: like that
01:40 <****> !rtfm create table
01:40 <****> (CREATE TABLE Syntax) : http://dev.mysql.com/doc/mysql/en/create-table.html
01:41 <****> chadmaynard: its not working :/
01:41 <****> keeps saying syntax error and what not.
01:41 <****> And im reading the docs on that, and its still not working capin!
01:41 <****> show me query and error
01:42 <****> create table if not exists tasks (
01:43 <****> and error is... You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if not exists (
01:43 <****> select version();
01:44 <****> 5.0.27
01:44 <****> hmm
01:45 <****> weird eh.
01:45 <****> http://pastebin.ca/753197
01:45 <****> works for me
01:46 <****> you sure you didn't type it wrong?
01:46 <****> did you copy/paste?
01:46 <****> it totally doesnt work for me
01:46 <****> oh wait, hang on
01:46 <****> hehe
01:46 <****> ok your one does
01:46 <****> ok
01:46 * jsoftw ponders
01:46 <****> jsoftw: show me entire query
01:46 <****> so now I am coalescing the crap out of my data
01:46 <****> lets see what happens
01:47 <****> prakriti: change the schema if you wan
01:47 <****> t
01:47 <****> standby...
01:47 <****> wtf
01:47 <****> I am still appaled that NULL doesn't = NULL
01:47 <****> when I paste it into a mysql query, it works, but if I use it in a .sql file it does not
01:47 <****> :\
01:48 <****> the paranoids are after me!
01:48 <****> jsoftw: i'm thinking you have a weird invisible character in your file
01:48 <****> or something
01:48 <****> prakriti: NULL IS NULL. NULL means unknown. We can't say two unknown values are equal because we don't know
01:49 <****> chadmaynard: ok it was the comments.
01:49 <****> --
01:49 <****> jsoftw: ah
01:50 <****> I thought -- was a valid sql comment
01:51 <****> How would I do a similar thing with rename? eg, rename table if exists foo to bar; ?
01:51 <****> I dont see any docs about that sort of syntax for the rename command.
01:55 <****> when doing ORDER BY how can I have results ordered 1, 2...10, 11 rather than 1, 10....
01:55 <****> Shai_Tan: if you use an number type instead of character type
01:56 <****> well, they are like q1, q2... q10 etc
01:56 <****> I should have been clearer
01:56 <****> Shai_Tan: eh. take out the q?
01:56 <****> I need the q
01:57 <****> Shai_Tan: is the format always (letter)(number) ?
01:57 <****> Is BOOLEAN closed or ENUM('open', 'closed') status best?
01:57 <****> LGL2000: define best
01:57 <****> it goes on q8, q8_1, q8_2, q8_3
01:58 <****> but always prefixed with q
01:58 <****> Shai_Tan: you'd have to split it up somehow
02:03 <****> chadmaynard: I'm back :) I built the mysql client on cygwinw without a problem but mysql++ still complains about not finding the mysql client library in a whole bunch of directories like /usr/lib64, /usr/lib, etc. Should I copy some directory from the mysql client I built to one of those places?
02:03 <****> de1: maybe create symlinks
02:05 <****> i have these .frm files that are missing a .myd and .myi and mysql reads them okay. but in another db the files that are orphaned, mysql doesnt know how to read them.
02:06 <****> Foesball: perhaps they're not myisam tables. for an innodb table, you would have frm but not the other two, for instance
02:07 <****> can someone tell me whats wrong with this command?
02:07 <****> i think these are innoDB. is there something i need to set to tell it to use innoDB format?
02:09 <****> can someone tell me whats wrong with this command? http://pastebin.com/d29c9a9a3 I get an error from mysql: ERROR 1046 (3D000) at line 1: No database selected
02:09 <****> Foesball: well, you can't just move around frm files f the tables are innodb, otherwise innodb's internal data dictionary gets confused.
02:09 <****> Foesball: in a nutshell, it'll just work
02:11 <****> chadmaynard: sorry somebody was at the door. How and what do you think I should link?
02:12 <****> chadmaynard : thanks for the help, i went ahead and changed my schema and things seem to be better
02:13 <****> de1: where is libmysqlclient.so It is looking in /usr/lib
02:14 <****> chadmaynard: Best as in best practice.
02:14 <****> LGL2000: bool
02:15 <****> chadmaynard: How come? The latter is less... "discriminating".
02:15 <****> LGL2000: more portable, smaller storage size
02:15 <****> ENUM isn't standard yet?!
02:15 <****> when trying to generate percentages, I am getting some odd results
02:16 <****> What do you do when you want multiple choices (over two) in other databases?
02:16 <****> Or if you wanna follow SQL?
Total 28 pages. You are browsing page 5/28.
First :: Prev :: [...] [3] [4] [5] [6] [7] [...] :: Next :: Last
