Re: Finding a record in a result set

2007-03-23 Thread Maciej Dobrzanski
"James Tu" <[EMAIL PROTECTED]> wrote in message = news:[EMAIL PROTECTED] > I want to do a query of all employees from Maine, ordered by hiring =20 > date, and figure out where Joe falls in that list. (i.e. which record = > number is he?) I think this can only be accomplished with a temporary ta

Re: Finding a record in a result set

2007-03-23 Thread Francesco Riosa
Maybe this one could do (untested) ? SELECT COUNT(*), ( SELECT count(*) FROM employees AS t2 WHERE t2.name = 'Joe' AND t2.state = 'ME' AND t2.hiredate <= ) AS joesexist FROM employees WHERE name <= 'Joe' AND state = 'ME' AND hiredate <= ; Jerry Schwartz ha scritto: I don't think that will wo

Re: Not Sorting Correctly

2007-03-23 Thread Francesco Riosa
It's possible to repeat with a varbinary field also in 5.1 CREATE TABLE t1 ( RoomNo varbinary(10) DEFAULT NULL, LastName varchar(25) NOT NULL, FirstName varchar(25) NOT NULL, ChapterID int(11) NOT NULL DEFAULT '358' ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO `t1` (`RoomNo`, `LastName`

Search relevance

2007-03-23 Thread Jerry Schwartz
I am having a problem using the full text search facility, and it has to do with the relevance score. When I do a Boolean search, the relevance score is always 1 or 0. That means sorting my search results by score does me no good: searching for "candy" first lists an item that only has the word "ca

Data truncation: Data too long for column....

2007-03-23 Thread prt
Hi to all, I developed java web application that runs on tomcat5 and MySQL 3.23.54, MySQL connector is mysql-connector-java-3.1.12-bin.jar. And everything work good. I Whant to change the MySQL to 5 version. So i install MySQL 5.0.27. Use MySQL connector mysql-connector-java-5.0.5-bin.jar. My we

Re: Need Database Connection Sans Password

2007-03-23 Thread David Blomstrom
You wrote, "You need to create a root password and other users." insert into mysql.user set Host='localhost', User='', * * * * * * * * * * Thanks, but that gave me an error message. I clicked on a particular database, then clicked Privileges and changed the pa

Re: Need Database Connection Sans Password

2007-03-23 Thread David Blomstrom
You wrote, "Is you MySQL properly installed ???" Apparently. I just finished reinstalling MAMP (Apache, PHP & MySQL for Mac), and I was able to copy a database I had created earlier into the MySQL folder. "Can you login to mysql client as root from your localhost ???" I'm not sure what you mean

Re: Need Database Connection Sans Password

2007-03-23 Thread Rolando Edwards
You need to create a root password and other users. insert into mysql.user set Host='localhost', User='', Password=PASSWORD(''), Select_priv='Y', Insert_priv='Y', Update_priv='Y', Delete_priv='Y', Crea

Re: Not Sorting Correctly

2007-03-23 Thread Rolando Edwards
MySQL seems to have a problem with using a function as an ORDER BY parameter If you move the SELECT query into a Aliased subselect and perform the ORDER BY outside the Aliased subselect that should produced the desired result select * from (select right(concat('000',roomno),3) AS text,firstname,l

Need Database Connection Sans Password

2007-03-23 Thread David Blomstrom
How would you write a database connection for a database on which you haven't yet established a username or password? None of the following work: $link = mysql_connect ("localhost" , "root" , "") or die(mysql_error()); mysql_select_db ("test", $link) or die(mysql_error()); $link = mysql_conne

Re: Not Sorting Correctly

2007-03-23 Thread Jesse
Strange. I'm running the same exact version, and it's not the same. What field types are you using? Mine are as follows: RoomNo VarChar(10) LastName VarChar(25) FirstName VarChar(25) the values that I put into Room No are "1","2","3", etc. I'm not storing "001","002","003", etc in there.

Re: Not Sorting Correctly

2007-03-23 Thread Jesse
make an alias for the field you want as sort key and use that. you don't need to do the calculation twice. I would not be surprised if the sort started to behave. Didn't help. The results are exactly the same. Jesse -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql

Re: how to dump triggers separately

2007-03-23 Thread Rolando Edwards
It would be advisable that your triggers be dumeds in association with your table structures like this mysqldump -h... -u... -p... --no-data --triggers However, the next line is what you are looking for mysqldump -h... -u... -p... --no-data --no-create-info --triggers - Original Message

how to dump triggers separately

2007-03-23 Thread asv
I need to create dump of all triggers in my database (This means that ONLY triggers must be dumped and nothing more: no data and no table structure). Is there any direct (or simple) way to do that? Mysqldump seems to be unable to do that. The only two ways i see -- to create a script that gets t

Availability of 5.1 as production release ?

2007-03-23 Thread Ulrich Staudinger
Hi there, first of all, thanks for the world's finest open source database! I would like to know if someone has an estimate for the availability of v5.1 as a production release. ? Thanks in advance, Sincerely yours, Ulrich -- MySQL General Mailing List For list archives: http://lists.mysql.c

Re: How to replicate a timestamp field

2007-03-23 Thread Maciej Dobrzanski
In news:[EMAIL PROTECTED], Bruno Rodrigues Silva <[EMAIL PROTECTED]> wrote: > this field (The master is dep= loyed Europe and the slave in Brazil). > The time of fly to replicate the que= ry that leave the master and go > to slave can be more than 1 second. Therefo= re, when this query is > execut

Re: Not Sorting Correctly

2007-03-23 Thread Zhaowei
Hi, Jesse, I did a small test and found it was in order. My version is +-+ | version() | +-+ | 5.0.22-community-nt-log | +-+ select right(concat('000',text_id),3) AS text,name from an order by right(concat('00