Returning All Rows That Repeat

2007-07-29 Thread John Kopanas
can compare their other fields. And I want to run a query once a day over the whole table to see if their are any repeats. Does anyone have a clue how to do this? Thanks :-) Your Friend, John -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http://www.soen.info

Re: Returning All Rows That Repeat

2007-07-29 Thread John Kopanas
Does it makes sense that on a table of 100,000 rows that my DB is crapping out with the following query? SELECT * FROM jobs GROUP BY customer_number, job_number HAVING count(*) 1 ORDER BY customer_number; :-) On 7/29/07, John Trammell [EMAIL PROTECTED] wrote: From: John Kopanas [EMAIL

Exporting Data To File and Can't Create/Write to File

2007-05-28 Thread John Kopanas
) I found this on mysql: http://dev.mysql.com/doc/refman/5.0/en/cannot-create.html I checked to see if root had File_priv and he/she does. I am developing this on Mac OS X but I am deploying on a linux box. Any input? :-) -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http

Re: Exporting Data To File and Can't Create/Write to File

2007-05-28 Thread John Kopanas
Directory existed but I did not have the right permissions on the directory for the mysql user. Thanks my friend. :-) On 5/28/07, Baron Schwartz [EMAIL PROTECTED] wrote: Hi, John Kopanas wrote: I am doing the following: echo 'SELECT * FROM jobs WHERE id = 1 INTO OUTFILE /Users/jkopanas

Why Is Autonumber Not Working With Following Query

2007-04-12 Thread John Kopanas
: Duplicate entry '5' for key 1 Why is the query trying to enter a duplicate entry? This makes no sense to me :-). Thanks John -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http://www.soen.info -- MySQL General Mailing List For list archives: http://lists.mysql.com

Re: Why Is Autonumber Not Working With Following Query

2007-04-12 Thread John Kopanas
/07, John Kopanas [EMAIL PROTECTED] wrote: I have the following query: INSERT INTO summaries (entity_name, job_type, job_status) (SELECT entity_name, GOV, Non-Workable FROM tmpSummaryTable); The only other column I have is id and it is primary key autonumber int. Why would I get the following

Re: How can I do something like this in mySQL...

2007-04-08 Thread John Kopanas
Mogens Melander +45 40 85 71 38 +66 870 133 224 On Sat, April 7, 2007 20:19, John Kopanas wrote: I have a query that looks something like this: SELECT (c_o_w_inst_rev - c_o_w_estcost)/c_o_w_inst_rev FROM tmpGovernmentSummaries The problem is that sometimes c_o_w_inst_rev is 0 and dividing

How can I do something like this in mySQL...

2007-04-07 Thread John Kopanas
of NULL? Can I test in the SELECT if c_o_w_inst_rev is 0 and return 0 and if not do the math? Insight would be greatly appreciated :-) -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http://www.soen.info -- MySQL General Mailing List For list archives: http

Re: Finding a Solution To A Distinct Problem of Mine

2007-03-13 Thread John Kopanas
BY from_user_id; In your original query I think you meant to select from, not to, since to will be 1; - Original Message - From: John Kopanas [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Sunday, March 11, 2007 12:59 PM Subject: Re: Finding a Solution To A Distinct Problem of Mine I

Finding a Solution To A Distinct Problem of Mine

2007-03-11 Thread John Kopanas
: SELECT DISTINCT to_user_id, created_at FROM messages WHERE to_user_id = 1 ORDER BY created_at; But the problem is that I only get distincts when I only have to_user_id in the SELECT clause. Any suggestions. I need to return everything on the latest row that has a distinct from_user_id :-). -- John

Re: Finding a Solution To A Distinct Problem of Mine

2007-03-11 Thread John Kopanas
I think I got it: SELECT * FROM (SELECT * FROM messages ORDER BY created_at DESC) as messages WHERE to_user_id = 1 GROUP BY from_user_id; Is this the best way about it... or are their better ways you suggest? On 3/11/07, John Kopanas [EMAIL PROTECTED] wrote: I have the following table

Re: Finding a Solution To A Distinct Problem of Mine

2007-03-11 Thread John Kopanas
Ok, did not work... hmmm... any other suggestions? On 3/11/07, John Kopanas [EMAIL PROTECTED] wrote: I think I got it: SELECT * FROM (SELECT * FROM messages ORDER BY created_at DESC) as messages WHERE to_user_id = 1 GROUP BY from_user_id; Is this the best way about it... or are their better

Easiest Way To Replicate DB

2007-01-25 Thread John Kopanas
with ease :-). Any sexy suggetions? :-) Your Friend, John -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http://www.soen.info -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: RE: Having Problem With Load Files and AutoNumber id fields

2006-11-27 Thread John Kopanas
860.674.8796 / FAX: 860.674.8341 -Original Message- From: John Kopanas [mailto:[EMAIL PROTECTED] Sent: Friday, November 24, 2006 11:13 AM To: mysql@lists.mysql.com Subject: Having Problem With Load Files and AutoNumber id fields Argh... I am autogenerating a load file after parsing

Re: Re: Performance Problems With Two Tables With Over 500K Rows

2006-11-26 Thread John Kopanas
is: innodb_buffer_pool_size | 8388608 That looks like 8MB... that sounds small if I have a DB with over 1M rows to process. No? Thanks again for your help. Your Friend, John On 11/25/06, Dan Nelson [EMAIL PROTECTED] wrote: In the last episode (Nov 25), John Kopanas said: Sorry about these questions

Re: Re: Re: Re: Performance Problems With Two Tables With Over 500K Rows

2006-11-26 Thread John Kopanas
. InnoDB does not keep track of how many rows are in a table, so it has to go count them when you do a SELECT COUNT(*) or in your case SELECT COUNT(id). That takes a little bit of time. Dan On 11/25/06, John Kopanas [EMAIL PROTECTED] wrote: If I just SELECT id: SELECT id FROM purchased_services

Re: Re: Performance Problems With Two Tables With Over 500K Rows

2006-11-26 Thread John Kopanas
] wrote: In the last episode (Nov 26), John Kopanas said: Thanks a lot for your help. The query should and only does return 1-6 rows depending on the id. Never more then that. Here are the comperative EXPLAINs: mysql EXPLAIN SELECT * FROM purchased_services WHERE id = 1000

Re: Re: Performance Problems With Two Tables With Over 500K Rows

2006-11-26 Thread John Kopanas
Yes... with FORCE INDEX it still takes 7 seconds. On 11/26/06, Dan Nelson [EMAIL PROTECTED] wrote: In the last episode (Nov 26), John Kopanas said: On 11/26/06, Dan Nelson [EMAIL PROTECTED] wrote: In the last episode (Nov 26), John Kopanas said: Thanks a lot for your help. The query

Table of type=memory is full... but not

2006-11-25 Thread John Kopanas
? Why does mySQL think it is full but does not think it exists at the same time? Help :-) -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http://www.soen.info -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: Table of type=memory is full... but not

2006-11-25 Thread John Kopanas
When I moved from type=memory to the default DB it worked fine. I am starting to think that the quantity of rows i.e. 550K approx was too much for my memory on my computer to handle. Does this make sense? On 11/25/06, John Kopanas [EMAIL PROTECTED] wrote: I create a memory table

Performance Problems With Two Tables With Over 500K Rows

2006-11-25 Thread John Kopanas
that is a PowerBook 867 with 756 MB of Ram. Feedback and insight would be greatly appreciated. Thanks my friends! :-) -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http://www.soen.info -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe

Re: Performance Problems With Two Tables With Over 500K Rows

2006-11-25 Thread John Kopanas
this on my laptop that is a PowerBook 867 with 756 MB of Ram. Feedback and insight would be greatly appreciated. Thanks my friends! :-) -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http://www.soen.info -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http

Re: Re: Performance Problems With Two Tables With Over 500K Rows

2006-11-25 Thread John Kopanas
/06, John Kopanas [EMAIL PROTECTED] wrote: I tried the same tests with the database replicated in a MyISAM engine. The count was instantaneous but the following still took 3-6seconds: SELECT * FROM purchased_services WHERE (purchased_services.company_id = 535263) The following though

Having Problem With Load Files and AutoNumber id fields

2006-11-24 Thread John Kopanas
accepting my numbers? Thanks :-) Does anyone also know how I can see the warnings created by loadfile? All I just see is the summary with skipped and warnings. Thanks :-) -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http://www.soen.info -- MySQL General Mailing

Performance Question And Problem

2006-11-23 Thread John Kopanas
improve my query? -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http://www.soen.info -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Re: Performance Question And Problem

2006-11-23 Thread John Kopanas
query? -- John Kopanas [EMAIL PROTECTED] John, I would split it into separate sql statements. 1) Create a memory table of the totals: drop table if exists CompanyTotals; create table CompanyTotals type=memory select Company_Id Id, SUM(annual_service_charge) ServCharge FROM

Updating One Table With the Sum() of a Grouping From Another...

2006-11-22 Thread John Kopanas
purchased_services GROUP BY company_id; This above gives me the company_id and service charge. How do I now put that SUM(annual_service_charge) into companies.total_annual_service_charge? Thanks my friends :-). -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http

Re: Updating One Table With the Sum() of a Grouping From Another...

2006-11-22 Thread John Kopanas
Ahhh... I did the following: UPDATE companies c SET total_annual_service_charge = (SELECT SUM(annual_service_charge) FROM purchased_services ps WHERE ps.company_id = c.id); What think you? :-) On 11/22/06, John Kopanas [EMAIL PROTECTED] wrote: I have two tables: companies, purchased_services

How Long Should It Take To Create an Index?

2006-11-17 Thread John Kopanas
. Should it be taking a long time? How long would some estimate it takes? Is there a way to estimate how long it takes? What factors affect the time it takes to create an index? Thanks for your help. Your Friend, -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http

Re: Re: How Long Should It Take To Create an Index?

2006-11-17 Thread John Kopanas
resources. Do a SHOW PROCESSLIST; to see if your index creation is blocked. Dan On 11/17/06, John Kopanas [EMAIL PROTECTED] wrote: I have a mysql table with 100K rows approximately. We are creating the following index: create index closed_base_cust_and_job on backlog_dev.closed_bases

How Do I Know If mySQL is using MyISAM or InnoDB?

2006-11-17 Thread John Kopanas
Is there a command at the command line that can tell me if I am using MyISAM or InnoDB? Thanks :-). -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http://www.soen.info

Importing Text File Into mySQL

2006-11-17 Thread John Kopanas
:-). -- John Kopanas [EMAIL PROTECTED] http://www.kopanas.com http://www.cusec.net http://www.soen.info -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Re: Importing Text File Into mySQL

2006-11-17 Thread John Kopanas
I am trying to figure out how this would work? How does LOAD DATA figure out when one column begins and another ends when some of the data are addresses with spaces in them? On 11/17/06, Dan Nelson [EMAIL PROTECTED] wrote: In the last episode (Nov 17), John Kopanas said: I have a text file