deleting "dead" customers

2001-08-22 Thread Tadej Guzej

Hello!

I have two tables. One contains invoices, one contains customers.
How do I delete customers that are not linked to any invoice.
The relation is one to many  (invoices --> customers).

I can select them with:
select customers.* from customers left join invoices on
invoices.cust_id=customers.id where invoices.id is null

but

delete from customers left join invoices on invoices.cust_id=customers.id
where invoices.id is null

fails.

Regards, Tadej


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




server changes my password

2001-08-20 Thread Tadej Guzej

Hi!
This is wierd:
Whenever I restart mysql server it somehow changes the password
for user tadej@localhost. The password for tadej@'%' remains unchanged
and I have to copy the password to the localhost entry.

I am running mysql 3.23.38-nt on windows 2000 advanced server.

Anyone knows how to fix this?

Thanks, Tadej

To satisfy the filter: database,sql,query,table


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




setting a character set

2001-08-20 Thread Tadej Guzej

I'm trying to use a charset different than latin1.
I did this:

I created a file - c:\my.cnf - and inserted the following text into it:
[client]
default-character-set=win1250
  
 I restarted mysql server and I still have latin1. What am I doing wrong ?
 
 
 Thanks, 
 Tadej

P.S.
For the filter: database,sql,query,table
How about including 'mysql' in filter words ???


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: MS Excel to MySQL upload macro?

2001-08-17 Thread Tadej Guzej

At http://www.icarz.com/mysql/index.html you can download a VB API that you
can also include in excell. It's an API that connects directly to mysql. The
API (MyVbQL.dll) is free and comes with an example program in VB.

Regards,

Tadej

- Original Message -
From: "Matt Wagner" <[EMAIL PROTECTED]>
To: "Craig Westerman" <[EMAIL PROTECTED]>
Cc: "MySQL-List" <[EMAIL PROTECTED]>
Sent: Saturday, August 18, 2001 6:17 AM
Subject: Re: MS Excel to MySQL upload macro?


> Craig Westerman writes:
> > I have data I create daily in MS Excel. I need to insert this data into
> > MySQL data base on my web server every night. Does anyone here have a VB
> > technique to upload to MySQL from Excel via a macro?
>
> Hi,
>
> There is an 'excel2mysql' perl script at the bottom of the
> 'Converters' section of our contributed software page:
>
>http://www.mysql.com/downloads/contrib.html
>
>
> Regards,
>
> Matt
>
> --
> For technical support contracts, visit https://order.mysql.com/
>__  ___ ___   __
>   /  |/  /_ __/ __/ __ \/ /Mr. Matt Wagner <[EMAIL PROTECTED]>
>  / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Herr Direktor
> /_/  /_/\_, /___/\___\_\___/   Hopkins, Minnesota  USA
><___/   www.mysql.com
>
>
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Benchmarking

2001-08-13 Thread Tadej Guzej

How do I benchmark 2 queries that return same results
without having mysql read from cache?

Example:
if i run the first query it will take 2 seconds, when I run the query
again, it takes 0.05 seconds.


And

What is the max. size of the index file that fits into 512M memmory, so that
mysql doesn't have to read the index file from disk?
Can someone explain the settings of that.


Thanks,
Tadej



Re: Select results to new table?

2001-08-09 Thread Tadej Guzej

INSERT INTO table_2 SELECT * FROM table_1 WHERE condition

or

CREATE TABLE table_2 SELECT * FROM table_1 WHERE condition
if your table_2 is not yet created

Regards,
Tadej


- Original Message -
From: "Eldon Ziegler" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 09, 2001 3:55 PM
Subject: Select results to new table?


> Is there a way to put the results of a SELECT into a table without going
> through an export file? For example, something like
> SELECT * FROM table_1 WHERE condition INTO table_2
>
>
> Eldon Ziegler
> ProAtion Systems
> [EMAIL PROTECTED]
> http://www.proation.com
>
>
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Large tables

2001-08-09 Thread Tadej Guzej

I have 3 tables that have all fieds the same (name, length, indexes...)
The only difference is that data is stored by year(1999 in table1999, 2000 in 
table2000, 2001 in table2001)
I don't want to merge them because each contains about 15,000,000 records and the 
index would'nt fit into memmory...

What I would like to do is compare for example august 1999, august 2000 and august 
2001.

I do it like this:


create temporary table tmp
select * from table1999 where month(dDate)=8;

insert into tmp
select * from table2000 where month(dDate)=8;

insert into tmp
select * from table2001 where month(dDate)=8;

select year(dDate), month(dDate), avg(zPrice), sum(zPrice) ... from tmp group by 
year(dDate), month(dDate);

Is there a way to do this without using a temporary table?


Any ideas?

Tadej



Re: Embedding MySQL in an application

2001-08-09 Thread Tadej Guzej

You could be more specific:
Try specifying your programming language and operating system at least.

- Original Message -
From: "Shawn P. Garbett" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 09, 2001 2:43 PM
Subject: Embedding MySQL in an application


> I have been told it is possible to embed MySQL in an application such that
> the user never knows a database is running underneath the app. Where can I
> find more information about doing this?
> --
> Shawn P. Garbett <[EMAIL PROTECTED]>
> See http://www.garbett.org/public-key for my PGP key
>
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: editor

2001-08-08 Thread Tadej Guzej

You can try FreeMascon.
It's a windows grafical UI client for MySQL. There you can find a query
editor that even highlights syntax. And it's free.
download at www.scibit.com

HTH, Tadej


- Original Message -
From: "Naintara Jain" <[EMAIL PROTECTED]>
To: "Stefan Hinz" <[EMAIL PROTECTED]>; "mysql" <[EMAIL PROTECTED]>
Sent: Wednesday, August 08, 2001 2:34 PM
Subject: RE: editor


> Dear Stefan,
>
> thanks for your input.
> actually all i need to know is say i type in a long sql query and make a
> typing error, is there any convenient way to retain the query and make the
> correction without having to re-type the entire query?
> eg. when i work with sybase on linux, i simply use 'vi' within sybase and
> can correct the last query in memory. Even Oracle has an editor for
> saving/editing queries and running them.
>
> I don't really need a query-creator. If i use notepad, copy and paste
> doesn't seem to work -- MSDOS hangs. Do i need to make them into script
> files and then run?
>
> regards,
>
> -Original Message-
> From: Stefan Hinz [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 07, 2001 12:38 AM
> To: Naintara Jain; mysql
> Subject: Re: editor
>
>
> Dear Naintara,
>
> what about Notepad (the windows standard editor)?
>
> Regards,
>
> --
>   Stefan Hinz
>   Geschäftsführer / CEO iConnect e-commerce solutions GmbH
>   #  www.js-webShop.com www.iConnect.de
>   #  Gustav-Meyer-Allee 25, 13355 Berlin
>   #  Tel: +49-30-46307-382  Fax: +49-30-46307-388
>
> - Original Message -
> From: "Naintara Jain" <[EMAIL PROTECTED]>
> To: "mysql" <[EMAIL PROTECTED]>
> Sent: Monday, August 06, 2001 7:02 PM
> Subject: editor
>
>
> > is there any editor available (eg vi on UNIX) that runs on MS-DOS to
> make
> > writing queries easier in MYSQL. I am a newbie.
> >
> >
> > -
> > Before posting, please check:
> >http://www.mysql.com/manual.php   (the manual)
> >http://lists.mysql.com/   (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
>
>
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Logging connections

2001-08-08 Thread Tadej Guzej

Well, the problem is that I don't know how to determine when a user
connects.
Sometimes a user is connected for only 10 ms, sometimes 10 minutes.
Do I have to do SHOW PROCESSLIST every 10 ms or is there a better sollution?

Thanks for the reply.

Tadej

- Original Message -
From: "Werner Stuerenburg" <[EMAIL PROTECTED]>
To: "Tadej Guzej" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, August 07, 2001 9:35 PM
Subject: Re: Logging connections


> You have timestamp fields in your table. When the user connects,
> you insert a row. The first timestamp field is set to the entry
> time automatically, you just record the user.
>
> When he disconnects, you update the second timestamp with the
> disconnect time. You can later compute the difference.
>
> I wonder how you find out about the latter.
>
> Tadej Guzej schrieb am Dienstag, 7. August 2001, 15:37:59:
>
> > How would I log connections to MySQL server?
> > I need the time user connects and the time user disconnects.
>
> > Thanks,
>
> > Tadej
>
>
> > -
> > Before posting, please check:
> >http://www.mysql.com/manual.php   (the manual)
> >http://lists.mysql.com/   (the list archive)
>
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>
> --
> Herzlich
> Werner Stuerenburg
>
> _
> ISIS Verlag, Teut 3, D-32683 Barntrup-Alverdissen
> Tel 0(049) 5224-997 407 · Fax 0(049) 5224-997 409
> http://pferdezeitung.de
>
>


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Logging connections

2001-08-07 Thread Tadej Guzej

How would I log connections to MySQL server?
I need the time user connects and the time user disconnects.

Thanks,

Tadej


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: perforamnce

2001-08-04 Thread Tadej Guzej

Well, sometimes I use all of the fields in the SELECT statement,
sometimes just one.
How about if I create both indexes?
How would it affect the performance? I don't care about update time as i
insert or update records at night only once a day.

Thanks for the answer

- Original Message -
From: "Kahled Al Sahmaa" <[EMAIL PROTECTED]>
To: "Tadej Guzej" <[EMAIL PROTECTED]>
Sent: Saturday, August 04, 2001 12:25 PM
Subject: Re: perforamnce


> Hello...
>
> that related to your select statement which you are use, if you have
> field1, field2 and field3 in the where section then the first index:
>
> CREATE INDEX ix1(field1, field2, field3);
>
> will be better for you, but if you are using select statements which has
been
> used one of that fields alon then the secound choice will be better.
>
>
>
> - Original Message -
> Subject: perforamnce
> Sent: Sat, 4 Aug 2001 12:53:15 +0100
> From: "Tadej Guzej" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> >
> >What is better:
> >
> >CREATE INDEX ix1(field1, field2, field3);
> >
> >or
> >
> >CREATE INDEX ix1(field1), ix2(field2), ix3(field3);
> >
> >I have a large table of some 30,000,000 records and am wondering
> >which indexing gives better performance and why.
> >
> >
> >How do I optimize search on this table - I'm using lots of OR statements
in
> WHERE clause.
> >
> >Thanks in advance,
> >
> >Tadej
> >
>
>
> Sincerely,
> Khaled Al-Sham'aa
> http://www.mazadmaktoob.com
>
> _
> Send Your favorite Arabic Card from Maktoob Cards,
http://cards.maktoob.com
>
>


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




perforamnce

2001-08-04 Thread Tadej Guzej


What is better:

CREATE INDEX ix1(field1, field2, field3);

or

CREATE INDEX ix1(field1), ix2(field2), ix3(field3);

I have a large table of some 30,000,000 records and am wondering
which indexing gives better performance and why.


How do I optimize search on this table - I'm using lots of OR statements in WHERE 
clause.

Thanks in advance,

Tadej