Re: Strange results from a query

2004-10-21 Thread Stephen E. Bacher
FYI, I ran the same scenario under MySQL 3.23.58 and it produced the results you wanted/expected: +--+-+-+ | col1 | A-count | B-count | +--+-+-+ |1 | 4 | 0 | |2 | 0 | 6 | +--+-+-+ So could it be a bug in

Re: need help for a query

2004-08-24 Thread Stephen E. Bacher
select name from mytable a where changedate (select changedate from mytable b where a.name=b.name and a.changedate != b.changedate); or: select name from mytable a where exists (select * from mytable b

Re: Figuring out the ranking position of an item on a table given its partnumber

2004-08-24 Thread Stephen E. Bacher
C.F. Scheidecker Antunes [EMAIL PROTECTED] wrote: I have a table that has a PartNumber and the Quantity of Items sold for each partNumber, that is: PartNumber Qty I need to get its sales raking given its PartNumber, that is. So if I order the table by Qyt in descending order the first record

Re: SQL question, SELECT DISTINCT

2004-08-17 Thread Stephen E. Bacher
I had a similar problem, but my criteria for selecting the value of f1 was different; it's a date field and I wanted only the rows with the most recent date value in that field, so only the latest of otherwise identical entries got inserted. I ended up doing something like this: create temporary

Re: In Statement Help

2004-08-03 Thread Stephen E. Bacher
Andrew Dixon [EMAIL PROTECTED] wrote: Hi Everyone. I require some help with an IN statement I'm trying to get working. I have inherited a database from someone else in which there is a table with project information and a field containing which geographic regions the projects relate. As a single

Re: Question

2004-08-03 Thread Stephen E. Bacher
[EMAIL PROTECTED] wrote: My connection to the mysql is correct, that is host, username, password, however when I click the link of form so that it will pull out data from mysql database, I see the php code of the form, any guidance, please. This is a Web server configuration issue. Assuming

Re: deleting duplicates from table

2004-07-19 Thread Stephen E. Bacher
Wesley Furgiuele [EMAIL PROTECTED] wrote: I think one way to solve it would be to move your data to a new copy of your table. Assuming record_ref and keyword are separate fields... CREATE TABLE newtable SELECT * FROM oldtable GROUP BY CONCAT( record_ref, keyword ); Or, more simply and

Re: query to see if db exists...........mysql_query( myQuery)

2004-05-28 Thread Stephen E. Bacher
On Thu, May 27, 2004 at 03:59:46PM -0400, Bono, Saroj AA R62 wrote: I am going to use mysql_query() and want to find out if a certain database exists. If mysql_real_connect() fails there are many errors that could account for this. The database may exist , and I cant take the error returned

Re: building 4.0.20 on Solaris2.7-x86 - make errors after configure

2004-05-28 Thread Stephen E. Bacher
Not sure if this will help, but we recently ran into a problem building MySQL on a Solaris 9 system - the build failed at the point of trying to make readline because of a missing file Makefile.in. It turned out that automake wasn't available, and automake is required to do the make. When we

Re: Select on Multiple columns

2004-05-19 Thread Stephen E. Bacher
Rocco Castino [EMAIL PROTECTED] writes: I would like, for example, to get the records starting from row number 6 (without, of course, working with the primary key, where the numbers could not necessarily be sorted as here): +++---+---+ | id_example |

Re: Importing Text Files in phpMyAdmin vs the Infamous

2004-05-11 Thread Stephen E. Bacher
I have a php website connecting to mysql database. How can i have a user export his database through the webpage to csv format? I would like the user to have a button he can press that would pop up a save as screen so he can save his database. The PHP code to do this would look something

Re: Use of AVG in where clause

2004-05-05 Thread Stephen E. Bacher
Julien Martin [EMAIL PROTECTED] wrote: I have a sql query as follows: ** SELECT DB_ESTABLISHMENT_NAME, AVG(DB_GRADE) FROM ESTABLISHMENTS ES LEFT OUTER JOIN GRADES GR ON ES.DB_ESTABLISHMENT_ID=GR.DB_ESTABLISHMENT_ID WHERE AVG(DB_GRADE) 2

Re: [PHP-DB] lamer noob with repeat question

2004-05-04 Thread Stephen E. Bacher
$result_insert = @mysql_query ($query_insert) or die(you suck! $mysql_error); Try mysql_error() instead of $mysql_error. - seb -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Another Trailing Spaces Issue

2004-04-30 Thread Stephen E. Bacher
If the string is theString + space and another row has an entry with theString (+ no space), the query returns BOTH rows. Is there a way to get around returning the latter entry? You could do something like: select stuff from mytable where stuff = 'foo ' and length(stuff) = 4; -- Steve

Re: Reports

2004-04-30 Thread Stephen E. Bacher
Is there a way to do report writing from Mysql databases? I want to transfer all the records from Mysql to a file. i used the Into OUTFILE but it doesnt display properly.I want to diplay it properly like records or reports. I wrote a basic Perl script to prettify the output of a MySQL