Re: Query to get count of ages

2006-09-19 Thread cnelson
> > But you can't get a group by from an alias. > > That surprises me. I tried putting the calculation of age in a > subquery but that didn't work, either. And I've never quite > figured out how to create a temporary table for intermediate > results. There has _got_ to be a way to do this, e

Re: Query to get count of ages

2006-09-17 Thread cnelson
> If your dateOfBirth is a date field, It is. > you can do this: > > select > (substring(curdate(),1,4)-substring(dateofbirth,1,4))- > (substr(curdate(),5) as age > from myTable; Thanks. That's a little more accurate (thought that doesn't quite matter in my case). > But you can't get a

Query to get count of ages

2006-09-15 Thread cnelson
I'm working on MySQL v5.0 and I have a table with dateOfBirth and I want a histogram of ages at a point in time. I tried something like: select round(datediff(curdate(), dateofbirth)/365) as age, count(age) from myTable group by age; but MySQL Query Browser says: Unknown column 'age' in

Re: Can't get v5.0.22 to work;alternatives?

2006-08-01 Thread cnelson
n> http://dev.mysql.com/downloads/ > Look for "older releases" Thanks but I want an older _build_ of the 5.0 release, not an older release. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Can't get v5.0.22 to work;alternatives?

2006-08-01 Thread cnelson
I filed bug #20941 (mysqld seg faults during instance configuration on XP pro, http://bugs.mysql.com/?id=20941) some time ago and have seen no real movement on fixing it. I'm dead in the water. I can't get MySQL v5.0 to work on my system. I'd like to try installing an older build as a stop gap

Can't configure instance w/ 5.0.22 instance wizard

2006-07-07 Thread cnelson
No matter what I do, it fails at the step where it's supposed to install and start the 'Windows service with an error 0. Is this a known issue? It sure would be nice to get more information about the failure from the wizard. -- MySQL General Mailing List For list archives: http://lists.mysql.co

Re: Scheduled Backups Issue...

2006-07-05 Thread cnelson
> I am attempting to set and and schedule automated MySQL backups > using the MySQL Administrator Tool downloaded from mysql.com. All > of my back ups work fien when I perform them manually. However > none of the scheduled backups ever get done. I am not sure where > the glicth is but here i

Warnings while trying to restore database

2006-06-15 Thread cnelson
I'm trying to restore a MySQL database in v5.0 (that minor number is in the teens, I don't have it at hand). I get a bunch of warnings like: Warning: Do not know how to handle this statement at line 28: CREATE TEMPORARY TABLE `CHARACTER_SETS` ( `CHARACTER_SET_NAME` varchar(64) NOT NULL default

Multiple engines in one DB a problem?

2006-05-23 Thread cnelson
I'm trying to find a weird performance problem in a MySQL database. I use MySQL v5.0 but the db was migrated forward from a v4.1(?) system. Looking at the schema in a recent backup, I was surprised to find different engines used for different tables: ... CREATE TABLE `comment` ( `id` int

Re: RE: Some queries use 100% CPU after restore

2006-03-17 Thread cnelson
> Have you tried Repair table or if InnoDB > ALTER TABLE ENGINE=InnoDB; > > Sometimes I've noticed after a restore or after adding lots of rows > performance is slow. REPAIR or the ALTER TABLE fixes it. I'll try that. Thanks. What's curious is that I've got one backup I can restore and have fi

Some queries use 100% CPU after restore

2006-03-17 Thread cnelson
I'm moving a database to a new server. I'm using MySQL v5.0.16 on 'Windows. I used the MySQL Administrator to backup on the old system and restore on the new one. Everything is fine _except_ on the new server, some queries take 2-3 minutes with MySQL using 100% of the CPU. I've dropped unne

Re: RE: Best way to design one to many queries

2006-03-08 Thread cnelson
> In this case, cnelson, you can only have a one to one relationship. Why? If the Attribute table keyed on (ProductID,Attribute), surely a 1:M is possible. > He wants to allow a one to many relationship. Yes, I know. > Using one field to store all the attribute ids in the product

Re: Best way to design one to many queries

2006-03-08 Thread cnelson
> Been wondering this for a while now, I can explain how I do it, but > I am sure there are better ways. > ... Maybe I'm really missing something here but I think that your querying problem arises from bad data design. This is what I'd do: Product table: ProductID some other stuff

Re: query help?

2006-02-23 Thread cnelson
> I am a novice when it come to queries such as this and was hoping > someone could help me write a query that tells me how many records > have the same ID and vendor number. > > |ID| vendor_no| date| > |2354 | 578 | "2005-12-23"| > |2355 | 334 |

Encrypted column example

2006-02-23 Thread cnelson
When 5.0 came out, I saw an article or white paper or something with an example of a stored procedure (I think, maybe a trigger) that allowed you to transparently encrypt a column so that even if a database backup was stolen, that column wouldn't be exposed to the thieves. I believe that the examp

Re: working w/UK postcodes

2006-01-09 Thread cnelson
> I need to do a search query on the columns called > > Name of business "the name of the business" > Town "Local town or city name" > Postcode" this is the same as your zip code" > Category"this is type of business ie dress shop bakers" > XY "this is the t

Creating a view from a join

2005-11-19 Thread cnelson
I have two tables with quite a few fields and I want to create a view into a limited join of the table. I have a query like: select * from person inner join student on person.id=student.id where person.dormant != 'Y'; The select works fine but when I try to use MySQL Query Brows

Re: RE: Backward-compatible authentication in v5.0?

2005-11-16 Thread cnelson
> Hi! It is a common error, have a look here: > http://dev.mysql.com/doc/refman/5.0/en/old-client.html > > I have had the same error. Tbanks. I found that -- eventually -- in the manual. It took several searches to find it but it seems to work now, not only for my Tcl application but for MySQL

Backward-compatible authentication in v5.0?

2005-11-16 Thread cnelson
I'm trying to upgrade MySQL from v4.x to v5.0 under an existing Tcl-based application that uses MySQLTcl and I'm getting: mysqlconnect/db server: Client does not support authentication protocol requested by server; consider upgrading MySQL client Is there something I can do to MySQL v5 server

Can't connect to MySQL v5.0.15 on 'Windows XP

2005-11-16 Thread cnelson
I've just installed MySQL v5.0.15 on my 'Windows XP system and most ways I want to connect to it fail. I don't see what I'm doing wrong. I've searched the manual, the web, and the forums without seeing anything that clearly addressed my problem. Help, please! If I navigate through Programs / MySQL