Home Page   #c  #ruby-lang  #cisco  #mysql  #apache  #javascript  #java  #perl  #php  #openmoko   Wallpapers Girl
Reliable $1 Web Hosting by 3iX

Channels


#mysql

19 October 2007


Total 26 pages. You are browsing page 26/26.

First :: Prev :: [...] [22] [23] [24] [25] [26] :: Next :: Last

23:17 <****>4.0ish. In 4.0 the only timestamp type auto-resets on every update if you forget to specify it should remain the same, right?
23:17 <****> thanks
23:21 <****> Simetrical: if it's the first timestamp column in the row. :)
23:22 <****> dkr, that's . . . weird.
23:22 <****> http://dev.mysql.com/doc/refman/4.1/en/timestamp.html
23:22 <****> 4.0, I'm talking about, not 4.1. Although probably it's the same.
23:22 <****> . . . anyway, for that reason MediaWiki (which supports 4.0) doesn't use the built-in date/time types.
23:23 <****> And nor do vBulletin, etc. Because if you forget the timestamp=timestamp bit in your UPDATE . . .
23:24 <****> Simetrical: there are types where that doesn't occur
23:24 <****> that's kind of silly. if you don't want features of a type of field you shouldn't use it
23:24 <****> HarrisonF, in 4.0?
23:24 <****> yes
23:24 <****> datetime
23:27 <****> quite often I actually have mytimestamp=now() instead of relying on the auto-update, heh.
23:27 <****> Hmm, so why do we not use DATETIME? I'll have to ask domas sometime.
23:28 <****> it uses less space could be a reason
23:28 <****> timestamp vs datetime, I mean
23:29 <****> Well, but we use something like BINARY(14), storing it as YYYYMMDDHHMMSS. Which is bigger than any dedicated type, let alone Unix time.
23:30 <****> erm.. why ?
23:30 <****> I have no idea.
23:30 <****> that's really lousy design, since you need to convert it for every operation you do on it!
23:30 <****> adaptr, no you don't. Why would you?
23:30 <****> Operations are comparison and retrieval.
23:31 <****> apart form a direct comparison, perhaps
23:31 <****> ah
23:31 <****> What else would you do to it?
23:31 <****> well, datetimes are often used to extract parts of the whole
23:31 <****> add hours, subtract days, etc
23:31 <****> Extracting parts of it works fine, with substring checking.
23:31 <****> If you want to compute differences and stuff, yeah, that would be a problem.
23:31 <****> I guess we don't have occasion to do that on the database level.
23:31 <****> still, the format you're showing is NOT binary, it's decimal ASCII
23:31 <****> just characters
23:32 <****> which is slightly better
23:32 <****> Maybe we're using CHAR(14), I can't remember.
23:32 <****> same difference in mysql4 :)
23:36 <****> guys, I can set FKs with phpmyadmin, or not yet?
23:39 <****> YammYgirlcoding: yes, you have to set it as an innodb table first though
23:39 <****> don't answer off topic questions, send him to #phpmyadmin :)
23:40 <****> lol
23:40 <****> well i got help in here the other day dkr and was just trying to give some help back :)
23:40 <****> lnxsmith: I was just joking around, of course
23:40 <****> i know
23:41 <****> I tried phpmyadmin once, thought it was nifty, but then went back to using the mysql client or perl code.
23:42 <****> hrm, that sentence applies to just abuot every mysql gui tool, query browser, etc. :)
23:42 <****> i really like phpmyadmin, it does everything i need
23:43 <****> very simple interface to create databases and tables, set permissions and everything
23:43 <****> lnxsmith ah thanks for the off help ^^
23:43 <****> YammYgirlcoding: anytime
23:43 <****> lnx so all tables must be innodb?
23:44 <****> or just the table taht will have a FK inside?
23:45 <****> YammYgirlcoding: on that i am not sure, but whenever i want to link tables in the database i have them all innodb
23:45 <****> ah cool :)
23:45 * YammYgirlcoding goes create the recipes tables finally \o/
23:46 <****> and what's best practice, have table names singular or plural?
23:47 <****> i do plural
23:47 <****> it's a matter of taste?
23:47 <****> but, not sure if that's the best, seems better to me
23:47 <****> well, yeah
23:48 <****> if you have a recipes table, you know it will hold recipes, and an individual recipe would be a particular row of that table
23:48 <****> but that's jus tme
23:49 <****> also, dont listen to me because i dont know what im talking about :)
23:49 <****> hehe
23:50 <****> http://channel9.msdn.com/ShowPost.aspx?PostID=158656
23:50 <****> there's some discussion on that topic
23:50 <****> ah cool :)
23:52 <****> I have 50 rows, and numbers 1, 4, 7, 11, and 19 have A = B. What is the syntax to select up to row 19 using something like "select all rows up to the fifth row where A = B?
23:52 <****> So, I'm fine with selecting as many rows as necessary to get at least five where A=B.
23:52 <****> putting LIMIT 5 ?
23:52 <****> Not exactly, because I don't want to exclude where A != B.
23:53 <****> ah
23:53 <****> hmm
23:53 <****> i dont know how a good db programmer would do it, but i'd probably just do a union
23:53 <****> is there an easy way to determine the size of a database before I dump it?
23:53 <****> I was trying to avoid that because it seems overkill...
23:54 <****> yeah lolotov, it does
23:54 <****> lolotov: wouldn't just a limit work?
23:55 <****> perhaps combined with order by
23:55 <****> ?
23:55 <****> Coudl you provide an example?
23:55 <****> I don't want: select * from blag where A=B limit 5
23:55 <****> select * from table where A = B ORDER BY A desc limit 19
23:55 <****> well, 19 can change.
23:56 <****> i was just through out examples.
23:56 <****> what do you mean 19 can change?
23:56 <****> let me try again
23:56 <****> as in you're having code run it and the code may want a different number of results?
23:57 <****> lolotov, is there an ORDER BY in your query?
23:57 <****> let's say I have 50 rows, all with a field A which is a varchar.
23:57 <****> field A can be anything within limits of varchar
23:57 <****> k
23:57 <****> lolotov, is there an ORDER BY in your query?
23:57 <****> so, I sort the tables according to their row number (actually an ID)
23:58 <****> gnari: yes, but i'm ordering by something else, not A.
23:58 <****> so now I've got a result of 50 rows sorted by X, but I only need as many as would fit the requirement of having 5 rows in that result where A=B.
23:59 <****> lolotov, ok let us say you order by unique column x. select * from foo where x<=(select max(x) from foo where A=B limit 5)
--- Log closed Sat Oct 20 00:00:06 2007


Total 26 pages. You are browsing page 26/26.

First :: Prev :: [...] [22] [23] [24] [25] [26] :: Next :: Last


Tutti i nuovi CAP Italiani. Come ottenere il database completo