| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10
Comments:
<0> | (utc_timestamp()-1139671348) | <0> +------------------------------+ <0> | 20059071483559 | <0> +------------------------------+ <0> 1 row in set (0.00 sec) <1> use <1> pastebin <0> something weird happens with the math <1> hashmysql.org/paste/ <2> pastebin plv <0> nobody was talking, and you guys have used almost as many lines asking me to use pastebin, just saying <2> this isn't a diplomatic negotiation <2> if you don't want to use the pastebin, then just don't paste the fluff <3> misty: what does utc_timestamp() return by itself? <0> jtacy: good point :( it's the wrong thing, I think I have gotten cofnused by which time function to use <0> ahh I want unix_timestamp
<0> thanks for your help <3> np <4> i am creating a chat, and i needed to know the proper data type to index the time a message was inserted <1> timestamp? <1> datetime? <4> thx <1> http://dev.mysql.com/doc/refman/5.0/en/date-and-time-type-overview.html <5> hi <5> could someone help me please with sql in general? i need to insert a new row if there is none with that key already. what's wrong with IF NOT EXISTS (SELECT key FROM table WHERE key = '[the key i want to insert]') THEN INSERT INTO table(key) VALUES('[the key i want to insert]') ? <6> what does the error message say? <5> infi: 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 (SELECT * FROM nagytabla WHERE szam = '17') THEN INSERT INTO nagyt' at line 1 <6> heh <5> is that a good heh or a bad one? :) <5> oh yeah, i used a different table and key name <7> Bandesz-: That's probably not a valid use of IF. <5> another option is just trying to insert and if there already is a row with that key, it won't let me anyway :) <5> but i thought checking it somehow would be nicer <7> Bandesz-: The more direct approach is to create a unique constraint on [key] and let the database insert or not depending upon whether the key is or is not already there. <5> do i need to make it unique? the key is supposed be the unique, isn't it? that's what makes it a key :) <5> i've already set it as the key <7> Bandesz-: A PK is already guaranteed to be unique. <7> Primary Key. <5> yeah, it's primary <7> That's all you need. <5> thanks. does the same work with adding columns? if there's already a column with that name it won't let me add another one, right? columns are unique,too <7> Bandesz-: You probably shouldn't be doing that dynamically. <5> i'm not <5> thanks for the help <7> Bandesz-: Make your schema changes as needed whenever you upgrade the application. <7> You shouldn't ever need to guess whether the field exists or not. <7> V3.x (before upgrade) does or does not have fieldx. <7> You already know that. <5> yeah, but it's part of a job i'm doing and i thought it wouldn't look so good getting tons of error messages from the server <6> if you know the schema, and your SQL statements are valid, it should be feeding you data, not errors :) <5> but trying to add another row with the same key won't give me the 'Duplicate entry for key blabla' error message? <6> use INSERT IGNORE <5> oh, good idea! <5> thanks <8> Yay! <9> hello <9> I got table (customerID, lastName, companyName). I need to order by "name", so it customer is not company (company is empty) order should be by lastName, otherwise on companyName. <9> it must be done with subselect? <9> because order by can't switch between columns, correct? <10> yeah .. you could maybe to some trickery with case inside your select list <10> otherwise it might be sufficient to order by multiple columns <10> sounds like that would actually be sufficient <9> no.. <10> but you could create a column in your select list .. lets call it "ordering" where you ***ign the column value to sort against for this row <9> because when customer is a company, lastName can be empty, so ORDER BY lastName, companyName will return all companies first <10> using a case <10> would nit be able to use an index of course <10> unless you denormalize <9> yeah, but is it optimized order by then? <9> when i use case? <10> it will need to do a temp table in memory i would ***ume <9> but it's not a problem now, i got 5.000 rows. <9> so wirtual column + order by it. <9> thanks ! <11> can i call a sp from within a trigger? <11> or even better: can I do an insert with a trigger? according to the trigger-"book" i can't - is that still the case? <11> oh according to the reference manual it is possible... great :)
<12> hi ppl <12> In which situations mysql4 decides not to cache statements? <13> i have mysql-noinstall-5.0.18-win32.zip and after extracting it and running mysqld, if i run \bin\mysql it says: ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using p***word: NO) <14> you are supposed to run the mysql client in the commandline <13> yes, i am doing just that <14> so try mysql -u root <14> or mysql --help <13> oh thanks <13> so the default user it was trying to connect with didn't exist ? <13> or maybe i'm missing windows components ? <14> the former <14> I think <15> i want to let my friend use a databse, but i dont know what to set the SQL host to <14> the default user is root with no p***word <13> then why it was trying to use ODBC ? :) <14> you need to read the docs on granting access <14> I have no idea <15> anyone know <14> I havent ever used the commandline client on win <14> when I used mysql on win last time, I dl'd the installer <14> and it gave me pretty shortcuts in the program menu <14> there's a gui management app <13> oh then i'm going to get that <13> can you tell me what are the most used database solutions now ? i only know of sql and foxpro <15> can anyone please help me, i know its probably really simple <6> hold on while I survey everyone on earth... <16> Jezek: : what host? where ? more info please <15> i have a site with mysql database, and i want to allow my friend on another site to access it <16> Jezek: From the first look at it, you must allow your friend to acces dbase server on firewall (strict rule), than create specific user on mysql itself for that person. <17> hello every one <18> hello <17> can some one answer my query ? <18> dont ask to ask a question. just ask a question <17> i want to replicate some tables from database instead of replicate whole db :) <17> dude blobaugh i did last time but no answer :) <18> heh <17> so do you have any idea ? <15> ok <16> I have sort of weird problem with phpmyadmin, it's SQL query window i rejecting (with an error) my stored proc queries (call proc1();) <17> any one <16> I repeatedely receive "#2013 - Lost connection to MySQL server during query " error <16> the proc is really simple (reate procedure p1() select "bang";) which i execute "call p1();" <18> L|NUX: i know that webmin can do it for you, im looking on google too <19> hello, is there a way to let mysql handle id collisions with these ids given in several insert statements? <6> olliwolli, perhaps you are looking for INSERT IGNORE <19> ill have a look, thx <6> alternately, there is INSERT ... ON DUPLICATE KEY UPDATE ... <18> L|NUX: http://lists.evolt.org/archive/Week-of-Mon-20030929/149244.html << take a look at that <17> ok <17> blobaugh : but if some one do not want to use webmin <18> look at that link <17> and his example is for same machine :) <17> and i am talking about different machines ;) <18> google it. theres a ton of info on how to transfer from the local to remote machines <17> i know <17> thx for the info <20> hello <20> what data type should i use to hold currency? i'm now using a double. is that correnct? <20> or should i use decimal? <18> i used a decimal(<somenumber>,2) <20> hmmm <20> blobaugh: but i need at least 5 decimal positions <18> i have used floats and doubles in the past as well but this way puts it in the correct position for money <18> decimal(predot,postdot) <20> blobaugh: ok, thanks... 1 more thing please.... <20> and for small decimal numbers like 20.25 ? <20> and for quantities with 3 decimals? <20> you always use decimal? <21> sorry, dialup... <21> when i have used decimal ive primarily used it for money purposes. the only issue is that it rounds up. for a large decimal number i may use a float. they are more precise <20> blobaugh_: all i nned is data type for: currency with 5 decimals, percent numbers, and quantities with 3 decimals <20> whay would you use ? <20> decimal(14,5) for currency <20> float for percent numbers?
Return to
#mysql or Go to some related
logs:
lcd brighteness fglrx apx apache2 debian #osdev nating on iptables #python debian cedega Could not load graphics driver 'x11drv' +process +to set priority +suse #kernel #linux pdaxrom change terminal key
|
|