ordering by frequency

2002-08-20 Thread Quinten Steenhuis
I have a simple query that I must have framed incorrectly, because MySQL returns an error: SELECT c.customerID,CONCAT(...) as Cust FROM customers c,invoice i WHERE c.customerID = i.customerID ORDER BY COUNT(i.customerID) LIMIT 0,10; This tells me ERROR : Invalid use of group function How

Re: ordering by frequency

2002-08-20 Thread Quinten Steenhuis
SELECT c.customerID,CONCAT(...) ,COUNT(i.customerID) as Num FROM customers c,invoice i WHERE c.customerID = i.customerID GROUP BY c.customerID ORDER BY Num DESC LIMIT 0,10 ; Sorry, solved my own difficulty. On Tue, 20 Aug 2002, Quinten Steenhuis wrote: Date: Tue, 20 Aug 2002 13:01:17 -0400

NULL values in a JOIN

2002-08-20 Thread Quinten Steenhuis
Sql, query Hi, I have a field that I need to do a join on. Unfortunately, the column is allowed to be null (and it should be). My plan is to return the literal string 'None' if the column is null, and otherwise to return the joined value. How can I do this, when the inner join that I want

Re: MySQL database design, one column, 10 entries?

2002-08-11 Thread Quinten Steenhuis
You need to add an additional table, favorites. It should have three columns: favoriteID INT, userID INT, favoriteTypeID INT REFERENCES FavoriteType. Plus the additional column for the rating, assuming it's associated with a favorite. Each row represents a single preference (this way users

Re: Text formating in Perl

2002-08-04 Thread Quinten Steenhuis
Use pre /pre around the text. If you look at the html source, I think you will find that the text is, in fact, formatted. Also, you could write a regular expression to replace a line break with a br. On Sun, 4 Aug 2002, eric wrote: Date: Sun, 4 Aug 2002 18:56:26 +0200 From: eric [EMAIL

MySQL 4.0 on Debian

2002-08-01 Thread Quinten Steenhuis
Hello all, Has anyone successfully gotten MySQL 4.02 running on Debian? I'm running into problems if I use alien to convert the RPMs. I could install from source, but I want to avoid cruftiness and make it easy to upgrade. Basically, I run into conflicts with the package libmysqlclient10, but

One-to-one relationship

2002-07-30 Thread Quinten Steenhuis
Hi, I'm not sure that this is the best forum, as it is more of a database design question, but I hope that someone can help me. I am creating a billing system. Each customer can pay via several methods, and over time methods of payment might be deleted or added. So, I use the one-to-one

One-to-one relationship

2002-07-30 Thread Quinten Steenhuis
Hope this isn't a repost - mysql,query,sql -- Forwarded message -- Hi, I'm not sure that this is the best forum, as it is more of a database design question, but I hope that someone can help me. I am creating a billing system. Each customer can pay via several methods, and

Re: order by date

2002-07-29 Thread Quinten Steenhuis
That's a really weird problem. Perhaps someone else could reproduce it if it's a bug in the most recent MySQL. I can think of an immediate way to solve it; use the type (datetime?), which is really a string 20020729. I don't see how this could be sorted incorrectly, but check your types. On

RE: graphical interface to mysql on red hat 7.3

2002-07-28 Thread Quinten Steenhuis
I've just tried out MyCC (also available at MySQL.com), which is technically in alpha, but has many of the features that phpMyAdmin has. It uses the QT widget set, so it looks nice, and I've found it to be functional. I usually end up sticking with phpMyAdmin though. I find that it's among the