#mysql - Thu 26 Apr 2007 between 15:08 and 15:22



phoenixzsalle: Is there a good way to sort "1 1a 1b 2 3 4 20 21" that it shows in that order?
MuisjeWhich function is better to use to add seconds to a timestamp/datetime field? date_add or timestampadd?
sallephoenixz: cast them to integers, but then 1a=1b and you can get them in any order
Muisje: + INTERVAL n SECOND
rglhackmiker, not that I known. you have to transform the tree into a table. like you said, use an "order" column, and maybe a "level" or "depth" one.
Muisjesalle so NOW() + INTERVAL numberofseconds SECOND?
salleMuisje: Just give it a try :)
hackmikerrgl, it already is a table. just that the rows have a 'parent' field which is the parent row's id
MuisjeDoes the number requires to be lower then 60 or can i just addup millions of seconds that way?
salleMuisje: It's very powerful.
hackmikerrgl, and they're unordered
rglhackmiker, to use a single select you have to have an "order" field.
hackmiker, you need to order them :D
hackmikercan't i just order alphabetically?
why?
salleMuisje: DELETE FROM x WHERE ts < NOW() - INTERVAL 1 MONTH; and you don't need to think about end-of-year, leap years etc.
MuisjeINSERT INTO trolls where nick = salle
rglhackmiker, what do you mean by that? what is an alpha sort on a tree?
salleMuisje: Only if you have columns called `salle` :)
rgl: Trees usually are represented as (id, parent_id)
hackmikerrgl, i want a query that gives me stuff in this order: 1. the first root node 2. the first child of the root node (first meaning first in table, any order), the child node of the first child node, etc, and for each row, a `depth` result (for html indentation)
rglsalle, sure. but that does not allow you to get the tree using a single select.
hackmikerwell that's my question
does it or doesn't it :)
sallergl: Entire tree you can select without WHERE clause :)
hackmikersalle, do you know how to do this?
sallergl: It's true that relational model does not work well for representing trees
rglsalle, oh, I wanted to say, a portion of a tree. like, a thread in a forum ;)
hackmikeri could just use multiple queries
rglhackmiker, well, using multiple queries, that is easy. just use recursion.
hackmikerbut maybe i don't need to
yeah it is easy :)
Laibschhakan_, all: After "rm columns_priv.frm func.frm proc.frm procs_priv.frm tables_priv.frm time_zone.frm" and running mysql_install_db a couple more times, I now successfully completed a backup (I wonder if there was anything left)
I guess I now need to reinstall permissions for access from the LAN and possibly recreate users, right?
hakan_Laibsch, yes
AndyGorewill I get speed and size benefits by declaring my columns as 'not null' ?
hakan_AndyGore, no
not null means that there has to be a value
actionseekwill thinks so
seekwillthinks so
AndyGorehakan_, but I thought it will use a byte less per row on that column ?

Page: 1 8 15 22 29 36 43 50 57 64 

IrcArchive