Need help in querying two tables

2003-08-01 Thread Jaime Teng
Hi, I have a table: mysql> describe archivetable; +---+--+--+-+-+---+ | Field | Type | Null | Key | Default | Extra | +---+--+--+-+-+---+ | sessionid | char(10) | | PRI |

need help with GROUP BY

2003-02-05 Thread Jaime Teng
I have a MySQL table: ++--+--+-+-++ | Field | Type | Null | Key | Default | Extra | ++--+--+-+-++ | id | int(10) unsigned | | PRI | NULL

How stable is MySQL 4.x vs 3.23.x?

2002-11-11 Thread Jaime Teng
Hi, How stable is the new MySQL 4.x? I've read some really nice and powerful stuffs with MySQL 4. x and surely like to use them. Is this still in the 'use at your own risk' stage? or is it stable enough for use already? regards, Jaime ---

Re: why is this slow?

2002-11-11 Thread Jaime Teng
e query statement, MySQL doesnot use index/keys? Does this mean, that there is absolutely no way to improve my query? Hmm.. I read lots of good stuffs with MySQL 4.x; is this already safe to use? regards, jaime > >Thomas > >On Mon, 11 Nov 2002 16:41:50 +0800 Jaime Teng <[EMAIL PROT

why is this slow?

2002-11-11 Thread Jaime Teng
Hi, I have a mysql table: mysql> describe eventlog; +-+--+ | Field | Type | +-+--+ | id | int(10) unsigned | | time| datetime | | source | varchar(10) | | description | varchar(255) |

slow search on INDEX?

2002-03-24 Thread Jaime Teng
Hi, I have this table: mysql> describe eventlog; +-+--+--+-+-++ | Field | Type | Null | Key | Default | Extra | +-+--+--+-+-++ | id | int(10)

how to configure my.cnf

2002-03-05 Thread Jaime Teng
Hi, Below is the content of my my.cnf file. I would like to get the optimum performance from MySQL and would like to modify some of the values. Specifically, my W2K Machine has 192MB of ram, what should I have in order for MySQL to take advanatge of that 192MB memory and what effect does it ha

Re: help with big table search

2002-02-25 Thread Jaime Teng
Hi, It appears fulltext has the potential for my particular problem. However, after altering my table to contain FULLTEXT, it did not help much: #1: SELECT * FROM eventlog WHERE detail like '%keyword%' ORDER BY id DESC LIMIT 20; #2: SELECT * FROM eventlog WHERE MATCH(description) AGAINST ('key

help with big table search

2002-02-24 Thread Jaime Teng
Hi, I have a table and currently has about 1.6 million entries. It is a table of events with date/time and description of the event. mysql> describe eventlog; +-+--+--+-+-++ | Field | Type | Null | Key | Default | Extr

Re: How can run Mysql program from different user (NOT only root) ?

2002-01-01 Thread Jaime Teng
Hi, Wasnt MySQL supposed to run as SU or ROOT or Administrator and then create users within MySQL with restrictions? What you trying to do was give "RUN MySQL rights" to your unix users. What if 3 unix users tried running mysql independently of each other and each mySQL process were trying to o

Need help with SELECT and JOIN pls

2001-12-07 Thread Jaime Teng
Hi, I have two tables: mysql> describe eventlog; +-+--+--+-+-++ | Field | Type | Null | Key | Default | Extra | +-+--+--+-+-++ | id | int(10

Re: help with timestamp...

2001-12-04 Thread Jaime Teng
Hi, Depends on what type of timestamp you are looking at. But in general, you use the mysql built in function: now() and if you want to convert that into unix_timestamp, unix_timestamp(now()) will do the trick. mysql> select now(); +-+ | now() | +--

Annoying DBD-mySQL error wont go away

2001-11-26 Thread Jaime Teng
Hi, I have been pulling my hair due to this annoying error. x( DBI::db=HASH(0x1d2998c)->disconnect invalidates 1 active statement handle (either destroy statement handles or call finish on them before disconnecting) a

How to join MsQL queries?

2001-09-21 Thread Jaime Teng
Hi, I have the following queries: SELECT account FROM user where username = 'george'; then using the result from this query, i pass it onto the next: SELECT * FROM record WHERE account = 'result from above'; I am new to 'JOIN' and dont know the correct join syntax. THANKS, jaime --

any sequence generator function?

2001-08-30 Thread Jaime Teng
Hi, Is there a "number sequence" generator/function in MySQL such that if I were to execute: "UPDATE mytable SET id = thisfunction;" it will update the table mytable and set the column id to a numbered sequence "1,2,3,4,5,6,7,8,9."? currently, i have a table with 2.5 million records and i wa

help renumbering unique

2001-08-30 Thread Jaime Teng
Hi, I have a mysql table: +---+--+--+-+ | Field | Type | Null | Key | +---+--+--+-+ | sessionid | int(10) unsigned | | PRI | | username | char(20) | | MUL | | start | int(10) unsigned | | M

help with crosstable SEARCH

2001-07-17 Thread Jaime Teng
Hi, I have two tables: whenever I tried doing this select, mysql would hang indefinitely trying to resolve it or at least took t long I would rather shutdown the whole machine. SELECT m.username, m.class, u.password FROM masterlist m, user u WHERE m.class <> '' LIMIT 20; However, when I in

help me with "select" query

2001-07-10 Thread Jaime Teng
Hi, I have a table: mysql> describe crossref; +---+--+--+-+ | Field | Type | Null | Key | +---+--+--+-+ | word | char(15) | | MUL | | id| int(10) unsigned | | MUL | +---+--+--+-+

Help me improve my table search

2001-07-05 Thread Jaime Teng
Hi, Below is the table I have mysql> describe eventlog; +-+--+--+-+ | Field | Type | Null | Key | +-+--+--+-+ | id | int(10) unsigned | | PRI | | timestamp | int(10) unsigned | | MUL |

different subdir for database

2001-07-04 Thread Jaime Teng
Hi, I have mysql on NT4 (soon to be win2000). one question is that the database files all reside under drive c. NT does not have symbolic link is there a way to tell mysql that a particular database is located on a different folder? where is the documentation for this one? jaime

mysql, perl and retrieving long column

2001-06-30 Thread Jaime Teng
Hi, If I have a table: create table messages ( id int unsigned not null unique, datalongtext ); and I have a perl script: 1 $sth = $dbh->prepare( "SELECT data FROM messages WHERE id = ?;"); 2 $sth->execute($id); 3 $data = $sth->fetchrow; QUESTION: will the script stop at line 3 unti

can I force SELECT to use a specified INDEX?

2001-06-25 Thread Jaime Teng
Hi, I have a table with several complex indexes: (source,description,timestamp,id) (timestamp,id) as well as individual indexes (id) (timestamp) (type) (source) (description) mysql> describe eventlog; +-+--+--+-+-++ | Field | Typ

Whats wrong here?

2001-06-23 Thread Jaime Teng
Hi, Why cant I get to make this simple statement to work? I have this perl script that would not resolve properly. ## my $sth = $DBH->prepare( qq!select start,stop FROM dialup WHERE sessionid = $sessionid! ); $sth->execute; my ($start,$stop) = $sth->fetchrow; ## T

Re: help with index

2001-06-22 Thread Jaime Teng
>> whats the difference between: >> alter table tablename add index (name); >> alter table tablename add index (age); >> alter table tablename add index (birthdate); >> alter table tablename add index (city); > >These are four INDIVIDUAL keys.. helpful if you want to search by name, >age, birthday

help with index

2001-06-22 Thread Jaime Teng
Hi, whats the difference between: alter table tablename add index (name); alter table tablename add index (age); alter table tablename add index (birthdate); alter table tablename add index (city); compared to: alter table tablename add index (name,age,birthdate,city); What I want is performa

help with select

2001-06-10 Thread Jaime Teng
Hi, I have a single table: CREATE TABLE hotel (name char(50),room char(20)); name is unique. but there can be one or more person assigned to any single room. I would like to perform a query to determine: who are living with 'BILL'? currently, i tried using: 1. get the room where BILL is in.

Re: running multiple mysqld's

2001-06-09 Thread Jaime Teng
Running two copies of mysqld in one single machine *HAS* its purpose. "What if, for whatever reason, mysqld died?" I personally havent seen mysqld died on me, but on a rare occasion, the database got corrupted and it made mysql useless. but if I made my application to be a bit more intelligent

help with select

2001-06-08 Thread Jaime Teng
Hi How do I perform this query using one operation? SELECT * FROM tablename WHERE account = (select account from tablename where name='BILL'); What I want is to lists all entries who's account is the same with 'BILL'. Thus far, what I know is to extract the account of 'BILL' and then perform an

need help with cross table update

2001-06-06 Thread Jaime Teng
Hi, I have two tables on mysql: Table1: class char(10) usernamechar(50) etc. etc.. Table2: class char(10) usernamechar(50) timeint unsigned etc.. Table2's "class" column is a new column addition and therefore does not have any values on it. I wa

help how to undo concat

2001-06-05 Thread Jaime Teng
Hi, I have a database column of char(250); I can insert enmass a string into said column using: update tablename set columnname = concat(columnname, 'string'); but how do I undo that? Is there a function that is exactly the reverse of concat such that: update tablename set columnname = uncon