| phoenixz | salle: Is there a good way to sort "1 1a 1b 2 3 4 20 21" that it shows in that order? |
| Muisje | Which function is better to use to add seconds to a timestamp/datetime field? date_add or timestampadd? |
| salle | phoenixz: cast them to integers, but then 1a=1b and you can get them in any order Muisje: + INTERVAL n SECOND |
| rgl | hackmiker, 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. |
| Muisje | salle so NOW() + INTERVAL numberofseconds SECOND? |
| salle | Muisje: Just give it a try :) |
| hackmiker | rgl, it already is a table. just that the rows have a 'parent' field which is the parent row's id |
| Muisje | Does the number requires to be lower then 60 or can i just addup millions of seconds that way? |
| salle | Muisje: It's very powerful. |
| hackmiker | rgl, and they're unordered |
| rgl | hackmiker, to use a single select you have to have an "order" field. hackmiker, you need to order them :D |
| hackmiker | can't i just order alphabetically? why? |
| salle | Muisje: DELETE FROM x WHERE ts < NOW() - INTERVAL 1 MONTH; and you don't need to think about end-of-year, leap years etc. |
| Muisje | INSERT INTO trolls where nick = salle |
| rgl | hackmiker, what do you mean by that? what is an alpha sort on a tree? |
| salle | Muisje: Only if you have columns called `salle` :) rgl: Trees usually are represented as (id, parent_id) |
| hackmiker | rgl, 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) |
| rgl | salle, sure. but that does not allow you to get the tree using a single select. |
| hackmiker | well that's my question does it or doesn't it :) |
| salle | rgl: Entire tree you can select without WHERE clause :) |
| hackmiker | salle, do you know how to do this? |
| salle | rgl: It's true that relational model does not work well for representing trees |
| rgl | salle, oh, I wanted to say, a portion of a tree. like, a thread in a forum ;) |
| hackmiker | i could just use multiple queries |
| rgl | hackmiker, well, using multiple queries, that is easy. just use recursion. |
| hackmiker | but maybe i don't need to yeah it is easy :) |
| Laibsch | hakan_, 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 |
| AndyGore | will 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 |
| action | seekwill thinks so |
| seekwill | thinks so |
| AndyGore | hakan_, but I thought it will use a byte less per row on that column ? |