Finding gaps in date intervals

2002-09-03 Thread Jens Vonderheide
Hi, I have a table with this structure: CREATE TABLE dats ( id INT UNSIGNED NOT NULL, id_ref INT UNSIGNED NOT NULL, start DATE NOT NULL, endDATE NOT NULL ) Now I am trying to create a query that will give me all intervals for which the table does not

RE: Keeping track of db structure changes

2002-04-28 Thread Jens Vonderheide
It's really not all that different that source code. For each application I build, I tend to put the source code in our CVS repository long with the $foo.sql file(s) to reconstruct the tables. Just as there's nothing preventing me from deploying a new release of an application before

Keeping track of db structure changes

2002-04-27 Thread Jens Vonderheide
Hi, is there any way to have MySQL automatically keep track of any changes I do with ALTER TABLE and later spit out the changes again? I use one database (well, actually several, but that's not important here) for development and one database for the production system. Now, whenever I change

RE: How can I set a char(2) column to always stay 2 chars?

2002-04-04 Thread Jens Vonderheide
Hi Dean, I have a table with a char(2) and when I send it '02' I want it to stay 02, but instead it stores 2 How do I make this store as '02'? Works for me: mysql create table t ( a char(2) ); Query OK, 0 rows affected (0.08 sec) mysql insert into t values ('02'); Query OK, 1 row

RE: group by year

2002-04-04 Thread Jens Vonderheide
I have a MySQL database containing records from several years. I want to calculate counts of records for each year and separate values for a couple of other fields. Each record contains a date-field, date. I tried putting the function YEAR(date) into a GROUP BY section, but this didnot work.

DRDB vs. MySQL replication

2002-03-27 Thread Jens Vonderheide
to MySQL but e.g. directly to the filesystem. Any thoughts on this? Jens Vonderheide REDLINK Mediendienste GmbH http://www.redlink.de/ - Before posting, please check: http://www.mysql.com/manual.php (the manual) http

RE: Restoring database from hotcopy

2002-01-12 Thread Jens Vonderheide
Hi Travis, I have the database files, now how do I put them back into mysql? mysqlhotcopy simply copies the data files to another directory. To restore them, terminate the mysql server and then copy the files back to the mysql data directory (e.g. /var/lib/mysql/db name). Note that

InnoDB: Checking occupied space

2001-12-09 Thread Jens Vonderheide
Hi, how can I check how much of the InnoDB data files are already taken? Jens (MySQL...) - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list

Re: Problem with a Select

2001-12-07 Thread Jens Vonderheide
Message From To Exampel 1 2 UserID UserName 1 Me 2 You Message From To ExampelMe You SELECT u.Message, u1.UserName AS From, u2.UserName AS To FROM Messages AS m, UsersAS u1, UsersAS u2 WHERE m.From = u1.UserID

Storing groups of groups

2001-11-30 Thread Jens Vonderheide
Hi, I am planning an authentication system that is structured much like the system Windows uses: I have users and groups. Groups can either contain users directly or can contain other groups (which can again contain groups etc). Now I am thinking on how to store and efficiently read those

Re: Designing a database to track files

2001-11-30 Thread Jens Vonderheide
Hi Erik, In the files table, each row corresponds to a separate file. There's all sorts of additional criteria, but the only one that matters to my question is the column called div_id. That's right, the number in That's exactly what I would recommend you to do. As you wrote, you can

Re: MySQL 3.23 Manual - PDF

2001-11-29 Thread Jens Vonderheide
If you wouldn't mind, though I think the folks at MySQL.Com should consider throwing a copy back up. Maybe I'm just a nervous nelly, but I won't be I agree with that. It wasn't really a problem using a manual for a subrevision higher than the version I used, but to V4, some things changed,

AW: UPDATE with values from another table?

2001-06-21 Thread Jens Vonderheide
is it possible to update fields of a table with values taken from another table? Like this (illegal) command would do: UPDATE b SET b.v = a.v WHERE b.id = a.id; Not yet. Multi-table deletes/updates are planned for MySQL 4.0, AFAIK. Then I have to stick to the method I am currently

UPDATE with values from another table?

2001-06-20 Thread Jens Vonderheide
Hi, is it possible to update fields of a table with values taken from another table? Like this (illegal) command would do: UPDATE b SET b.v = a.v WHERE b.id = a.id; Jens - Before posting, please check:

Ordering by given list

2001-05-06 Thread Jens Vonderheide
Hi, if I use a query like SELECT id FROM table WHERE id IN (7,2,100,65) is it possible to get the results ordered in exactly the same way as the IN list (7,2,100,65)? Mit freundlichen Grüßen, REDLINK Mediendienste Jens Vonderheide, Dipl.-Inform. Telefon: (0171) 8395997

AW: mysql with php4

2001-04-08 Thread Jens Vonderheide
Why does it give the old version number ? Have I done something wrong ? Should I put --with-mysql=/path/to/mysql ? Yes, you should. If you leave out the path, PHP uses a MySQL library shipped with the PHP source code. You should have gotten a warning after the ./configure for PHP, explaining

Re: Need Help with RH 7.0 RPM install

2001-04-08 Thread Jens Vonderheide
I have not been able to figure this out, yet. I found the file /usr/share/mysql/make_binary_distribution and tried a make on it; no luck. I scoured the documentation on the web and in my own distribution and have not been able to find out what to do next. See Below. I would appreciate

Re: Primary key ID gets messed up after deleting/adding

2001-04-08 Thread Jens Vonderheide
When I first added about 10 records and then deleted a few records and then added more records it didn't replace the missing records. That's MySQL's usual behaviour. auto_increment only garantees to create unique keys. "Holes" left by deleting data are not filled. Jens

Re: Primary key ID gets messed up after deleting/adding

2001-04-08 Thread Jens Vonderheide
How would you actually overcome that? Wouldn't it be good if MySQL would be adapted to actually do this for you? I think that not reusing deleted numbers is easier (i.e. more efficient). IIRC, earlier versions of MySQL in fact reused the numbers. There are 2 ways to overcome this: 1) Check

Re: ./configure help

2001-04-07 Thread Jens Vonderheide
err mex: configure: error: installation or configuration problem: C compiler cannot create executables Take a look at config.log, you will usually find the real cause for the error in there. Jens - Before posting, please

AW: Duplicate of Everything in Table

2001-04-05 Thread Jens Vonderheide
So, when I am calling info from this database, I get doubles of each result. How can I delete just one of each entry, so I am left with just: Use: DELETE FROM table WHERE condition LIMIT 1 Jens - Before posting, please

AW: suggestions for implementing heavily used log tables with nightly delete

2001-03-19 Thread Jens Vonderheide
I basically have a situation where 300,000+ rows are being inserted into a log table daily, and also needing to be cleared out based on a tstamp. What I've found is that the inserts work fantastic, but when I got to do the delete, even if it doesn't do anything, it sits there and blocks

AW: Table Full Error

2001-03-16 Thread Jens Vonderheide
I tried to query below, "select src_ip, byte, packet from table group by src_ip order by bytes desc limit 10" Then DB said, "ERROR 1114: The table 'SQL2997368_0' is full." MySQL tries to create a temporary table to handle your "order by" command. These tables are usually created in /tmp

Re: Failover and Replication [HOWTO]

2001-03-15 Thread Jens Vonderheide
Hi Bogomolnyi, I am really interested in your scripts. I don't have a use for them at this time, but I am planning to use a fallback system myself in the next few month. 5 pc , and I use it for a web cluster (10 pc) so I use 1 slave for 2 httpds Do you have a similar scheme for the web