RE: Slow Query Question - Need help of Gurus.

2004-04-18 Thread Ben Dinnerville
>>The indexes were listed at the bottom of the original post. Woops, didn’t see that far down, should have scrolled a little further :) >>What is needed, I expect, is a >>multi-column index on those 2 columns: >> >> ALTER TABLE 31909_859552 >> ADD INDEX Tag_Created (`Call Svc Tag ID`, `Jou

www.SQL-Scripts.com web site

2004-04-18 Thread SQL-Scripts.COm
Hello, Teh other day I posted an annoncement about my new web site www.SQL-Scripts.Com . It is a place were you can find SQL scripts for database system. You can even lodge your own scripts and help someone out there. I have started a monthly contest on the site now. The first people to lodge 2

Re: Slow Query Question - Need help of Gurus.

2004-04-18 Thread Michael Stassen
Ben Dinnerville wrote: You have a redundant clause in your query - the distinct is not needed when you are doing a group by on the same field ('Call Svr Tag ID') - not sure how the optimiser in MySQL will handle this. In some RDBMS's the duplicate clause will be optimised down to 1 clause, so you

Re: sql scripts

2004-04-18 Thread Robert J Taylor
Dudley F. Cañas wrote: hi ppl, im a newbie to mysql but been using oracle for quite sometime now and i found that mysql is not bad at all :) i was just wondering if is there an equivalent scripting method of coding like plsql scripts in mysql... ? TIA Stored Proceedures are currently imp

sql scripts

2004-04-18 Thread "Dudley F. Cañas"
hi ppl, im a newbie to mysql but been using oracle for quite sometime now and i found that mysql is not bad at all :) i was just wondering if is there an equivalent scripting method of coding like plsql scripts in mysql... ? TIA -- ___| |_ _ ___| | | ___ _ _ __ _ _ __ __

Re: varchar < 4 = char < 4? Why?

2004-04-18 Thread Robert J Taylor
Robert A. Rosenberg wrote: At 13:34 -0400 on 04/18/2004, Stormblade wrote about varchar < 4 = char < 4? Why?: This has been puzzling me. At first I thought it was something that Navicat was doing but I also tried in EMS MySQL and it does the same. If I set the type of a field t

Re: varchar < 4 = char < 4? Why?

2004-04-18 Thread Robert A. Rosenberg
At 13:34 -0400 on 04/18/2004, Stormblade wrote about varchar < 4 = char < 4? Why?: This has been puzzling me. At first I thought it was something that Navicat was doing but I also tried in EMS MySQL and it does the same. If I set the type of a field to varchar and set the length to anything less

MySQL4 and phpBB

2004-04-18 Thread Mark Susol | Ultimate Creative Media
I have recently setup a new server running EnsimPro 3.7 (Fedora) and upgraded the MySQL to 4.0.17-max per their tech notes. Now, I'm having troubles with tables related to my most busiest site becoming corrupt. The site in question uses phpBB. We've checked the hard drive out and don't think we ha

Re: Simple Select (You'd think)

2004-04-18 Thread Michael Stassen
Of course. My fault. item_id is in both tables, so it's ambiguous unless you specify. Glad you figured it out. Michael Richard Williams wrote: Thank you very much that worked great except I had to make it "select new.item_id". Richard Subqueries are supported staring with mysql 4.1. I'

RE: Slow Query Question - Need help of Gurus.

2004-04-18 Thread Ben Dinnerville
You have a redundant clause in your query - the distinct is not needed when you are doing a group by on the same field ('Call Svr Tag ID') - not sure how the optimiser in MySQL will handle this. In some RDBMS's the duplicate clause will be optimised down to 1 clause, so you wont cop a performance h

Re: Simple Select (You'd think)

2004-04-18 Thread Richard Williams
Thank you very much that worked great except I had to make it "select new.item_id". Richard Subqueries are supported staring with mysql 4.1. I'm guessing you have an earlier version. You can rewrite your query as a join, though. SELECT item_id FROM new LEFT JOIN old using (item_id)

HELP!!! - FRM -Files are deleted

2004-04-18 Thread Gerd JuppJacke
Hello, I need fast help. My .frm-files are deleted on MyIsam MySQL. The other two files types (myd and myi) of each table are still there but the frm-files are deleted. The database does not work any more. How can i reconstruct the database with the two types to save everything. Thx for fast h

Re: GRANT SHOW DATABASES

2004-04-18 Thread Michael Stassen
SHOW DATABASES is a global privilege. It allows the named user to see (with SHOW DATABASES) dbs he/she cannot work with. If that's really what you want, the syntax for your 4th line would be: GRANT SHOW DATABASES ON *.* TO [EMAIL PROTECTED] You use *.* instead of OSMS.* because this is glob

Re: Simple Select (You'd think)

2004-04-18 Thread Michael Stassen
Subqueries are supported staring with mysql 4.1. I'm guessing you have an earlier version. You can rewrite your query as a join, though. SELECT item_id FROM new LEFT JOIN old using (item_id) WHERE old.item_id IS NULL; See the manual

GRANT SHOW DATABASES

2004-04-18 Thread Roderick Luo
Hi - I'm a new user to mysql and have a short question. I ran the following lines: GRANT ALL PRIVILEGES ON OSMS.* TO [EMAIL PROTECTED] IDENTIFIED BY 'openipmp' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON OSMS.* TO [EMAIL PROTECTED] IDENTIFIED BY 'openipmp' WITH GRANT OPTION; GRANT ALL PRIVILEGES O

Simple Select (You'd think)

2004-04-18 Thread Richard Williams
This is my first post so forgive me if I put it in the wrong place or screwed it up in some way. I have two tables, "new" and "old" and I want to show all rows in one table that do not appear in the other table. I tried this select from the manual section "14.1.8.3 Subqueries with ANY, IN, and

Re: ORDER BY WITH NO PRINT

2004-04-18 Thread Tobias Asplund
On Fri, 26 Mar 2004, Seena Blace wrote: > Select group,hostname,details from table1 order by group; > > I want the output should be like > Group hostname details > aa abababa > abababababab >zzz

Re: varchar < 4 = char < 4? Why?

2004-04-18 Thread Michael Stassen
Stormblade wrote: Thanks for the explanation. Heh I should have realized that. varchars are probably implemented as null terminated strings and so they need an extra byte for the terminating char (Null or otherwise). Yeah it's definitely doing me a favor as my reason for varchar was space. So what

Re: varchar < 4 = char < 4? Why?

2004-04-18 Thread Stormblade
Thanks for the explaination. Heh I should have realized that. varchars are probably implemented as null terminated strings and so they need an extra byte for the terminating char (Null or otherwise). Yeah it's definitely doing me a favor as my reason for varchar was space. So what happens if I sto

Re: Datetime Default Value

2004-04-18 Thread Stormblade
On Sun, 18 Apr 2004 14:42:51 -0400, Michael Stassen wrote: > Stormblade wrote: > >> On Sun, 18 Apr 2004 12:17:00 -0400, Michael Stassen wrote: > Functions are evaluated by the server. The client only sends queries and > receives results. So, CURDATE() and NOW() are server time, not client tim

Re: Datetime Default Value

2004-04-18 Thread Stormblade
On Sun, 18 Apr 2004 13:54:22 -0400, Rhino wrote: > Stormblade (and anyone watching this thread), > > Just watch yourself when deciding between DATETIME and TIMESTAMP; the two > datatypes support very different ranges of values! Thanks for the heads up! > > According to the manual, DATETIME can

Re: varchar < 4 = char < 4? Why?

2004-04-18 Thread Michael Stassen
In MySQL, the only practical difference between a CHAR and a VARCHAR is how it is stored. CHARs are fixed-length, so they are fast but can waste space. VARCHARs are variable length, so they are slow but (usually) save space. That's the key here -- the only advantage to a varchar is the space s

Re: Datetime Default Value

2004-04-18 Thread Michael Stassen
Stormblade wrote: On Sun, 18 Apr 2004 12:17:00 -0400, Michael Stassen wrote: Stormblade wrote: Hey all, I'm currently converting a SQLServer 2000 database over to MySQL. I have a web application that currently uses SQLServer but will be using MySQL soon as I can get this done. I was able to m

Re: Datetime Default Value

2004-04-18 Thread Rhino
Stormblade (and anyone watching this thread), Just watch yourself when deciding between DATETIME and TIMESTAMP; the two datatypes support very different ranges of values! According to the manual, DATETIME can store any value between '1000-01-01 00:00:00' and '-12-31 23:59:59' but TIMESTAMP ca

varchar < 4 = char < 4? Why?

2004-04-18 Thread Stormblade
This has been puzzling me. At first I thought it was something that Navicat was doing but I also tried in EMS MySQL and it does the same. If I set the type of a field to varchar and set the length to anything less than 4 it will get converted to a char type of the same length. Now I know that char

Re: Datetime Default Value

2004-04-18 Thread Stormblade
On Sun, 18 Apr 2004 12:17:00 -0400, Michael Stassen wrote: > Stormblade wrote: > >> Hey all, >> >> I'm currently converting a SQLServer 2000 database over to MySQL. I have a >> web application that currently uses SQLServer but will be using MySQL soon >> as I can get this done. >> >> I was able

Re: Datetime Default Value

2004-04-18 Thread Michael Stassen
Stormblade wrote: Hey all, I'm currently converting a SQLServer 2000 database over to MySQL. I have a web application that currently uses SQLServer but will be using MySQL soon as I can get this done. I was able to match data types but so far I have not found a way to let the database handle sett

Re: Datetime Default Value - I want to know too!

2004-04-18 Thread Stormblade
Changing the SQL works fine as long as: a) You have access to the application source and/or the SQL source b) There is only one application and it runs on the same machine as the database. If you change your SQL what happens if you have several applications all in different timezones that use the

Re: Datetime Default Value - I want to know too!

2004-04-18 Thread Adam
This is a great question! I also work on SQL Server (2k) databases as well as Access and MySQL. I run into the same problem. So far, I've just changed the SQL in my applications, but I also would like to know if a default can be set. Regards, Adam On Apr 18, 2004, at 12:01 AM, Stormblade wrote:

newbie question: best column type for other languages

2004-04-18 Thread Venkatesh Madurai
Hello ! I am not very sure about this, and so, this could be viewed as a dumb newbie question. I need to add various data in different languages into mysql. The data includes characters such as "A`WmdV²”, “JÆÁõu, ÁÈøÓ uÁÔ¯, ÃnõÚ, ö£õ´¯õÚ,£¯ÚØÓ” , etc. Later, on a web page, people would sea

Re: Trying to run multiple statements through MySQL monitor

2004-04-18 Thread Jigal van Hemert
> Normally I'd write a > query with a sub select to get that information - something like this: Normally I'd NOT use a subquery ;-) > SELECT a.* > FROM table a > WHERE a.ssn IN (SELECT b.ssn FROM table b GROUP BY b.ssn HAVING > count(b.ssn) > 1); > > However, I don't have MySQL 4.1.x so th