Re: Narrowing a SELECT statement by multiple hits

2014-02-17 Thread Jennifer
On Feb 12, 2014, at 6:30 PM, Larry Martell wrote: Try adding a having clause, e.g.: SELECT `ip`,`page`,`url`,`time_stamp` FROM `ip_addresses` WHERE (`time_stamp` BETWEEN date_add( CURDATE(), INTERVAL -1 DAY ) AND CURDATE() - INTERVAL 1 SECOND) AND TRIM(`referrer`) LIKE '' HAVING

Re: Narrowing a SELECT statement by multiple hits

2014-02-17 Thread Roy Lyseng
Hi Jennifer, please try filtering with a subquery that locates ip addresses with more than 1 attempt: SELECT ip, page, url, time_stamp FROM ip_adresses WHERE existing where clause AND ip IN (SELECT ip FROM ip_addresses WHERE existing where clause

Re: Narrowing a SELECT statement by multiple hits

2014-02-17 Thread Jennifer
On Feb 17, 2014, at 10:17 AM, Roy Lyseng wrote: please try filtering with a subquery that locates ip addresses with more than 1 attempt: Hi Roy, That did it! Thank you so much!!! Now I just need to study that IN clause to see what's going on there. If this is too slow, you may

Re: Narrowing a SELECT statement by multiple hits

2014-02-17 Thread Roy Lyseng
Hi Jennifer, great that it worked. Try replacing the line `ip` IN (temp_ip) with `ip` IN (SELECT ip FROM temp_ip) Each subquery needs to be a complete SELECT query. Thanks, Roy On 17.02.14 21:11, Jennifer wrote: On Feb 17, 2014, at 10:17 AM, Roy Lyseng wrote: please try filtering

Re: Narrowing a SELECT statement by multiple hits

2014-02-17 Thread shawn l.green
Hi Jennifer, On 2/17/2014 3:11 PM, Jennifer wrote: CREATE TEMPORARY TABLE temp_ip AS (SELECT `ip` FROM `ip_addresses` WHERE (`time_stamp` BETWEEN date_add( CURDATE(), INTERVAL -1 DAY ) AND CURDATE() - INTERVAL 1 SECOND) AND TRIM(`referrer`) LIKE '' GROUP BY `ip` HAVING

Re: Narrowing a SELECT statement by multiple hits

2014-02-17 Thread Jennifer
a complete SELECT statement from before, that was good enough, but no. There's always something new to learn! Thanks again, Jenni Superior Shelving Systems The (Storage|Office|Display|Warehouse) Shelving Specialists Since 1984 Metro Shelving: http

Narrowing a SELECT statement by multiple hits

2014-02-12 Thread Jennifer
Hello, I have the following SQL statement that I'd like to add to. It's used to create a report that's emailed to me showing hits to our site that didn't provide a referrer. However, I only want to report on multiple hits from the same IP address - not just a single hit by someone.

Re: Narrowing a SELECT statement by multiple hits

2014-02-12 Thread Larry Martell
On Wed, Feb 12, 2014 at 7:35 PM, Jennifer jenni...@superiorshelving.com wrote: Hello, I have the following SQL statement that I'd like to add to. It's used to create a report that's emailed to me showing hits to our site that didn't provide a referrer. However, I only want to

Re: Complex MySQL Select Statement Help

2013-02-03 Thread hsv
2013/02/02 12:58 -0600, Peter Brawley On 2013-02-01 10:18 PM, h...@tbbs.net wrote: 2013/01/31 22:24 -0600, Peter Brawley Is this what you mean? Select, pricelist If( !IsNull(specialprice) And specialprice unitprice And CurDate() Between startingDate And endingDate, specialprice, unitprice )

Re: Complex MySQL Select Statement Help

2013-02-02 Thread hsv
2013/01/31 22:24 -0600, Peter Brawley Is this what you mean? Select, pricelist If( !IsNull(specialprice) And specialprice unitprice And CurDate() Between startingDate And endingDate, specialprice, unitprice ) as used_price From catalog Where itemid='WB314'; PB Maybe this is gilding the

Re: Complex MySQL Select Statement Help

2013-02-02 Thread Peter Brawley
On 2013-02-01 10:18 PM, h...@tbbs.net wrote: 2013/01/31 22:24 -0600, Peter Brawley Is this what you mean? Select, pricelist If( !IsNull(specialprice) And specialprice unitprice And CurDate() Between startingDate And endingDate, specialprice, unitprice ) as used_price From catalog Where

Complex MySQL Select Statement Help

2013-01-31 Thread Angela Barone
Hello, I'm trying to write a select query that grabs two prices from my db and displays them on a web page. I want it to grab the `listprice`, and either the `unitprice` or the `specialprice` depending on the following criteria: if the `specialprice` is not empty, AND it's less than

Re: Complex MySQL Select Statement Help

2013-01-31 Thread Peter Brawley
On 2013-01-31 8:13 PM, Angela Barone wrote: Hello, I'm trying to write a select query that grabs two prices from my db and displays them on a web page. I want it to grab the `listprice`, and either the `unitprice` or the `specialprice` depending on the following criteria: if the

RE: export result from select statement

2011-01-10 Thread Jerry Schwartz
-Original Message- From: LAMP [mailto:l...@afan.net] Sent: Sunday, January 09, 2011 9:46 PM To: mysql@lists.mysql.com Subject: Re: export result from select statement maybe it's clear to other but it's pretty unclear. #mysql -username -p select * from table_name where id=123 '/home/me

RE: export result from select statement

2011-01-10 Thread Jerry Schwartz
-Original Message- From: Michael Dykman [mailto:mdyk...@gmail.com] Sent: Sunday, January 09, 2011 3:02 PM To: LAMP; mysql@lists.mysql.com Subject: Re: export result from select statement I second Jerry's recommendation. It always works like a charm for me. [JS] Thanks. By the way

RE: export result from select statement

2011-01-09 Thread Jerry Schwartz
: 860.674.8341 E-mail: je...@gii.co.jp Web site: www.the-infoshop.com -Original Message- From: LAMP [mailto:l...@afan.net] Sent: Saturday, January 08, 2011 6:05 PM To: mysql@lists.mysql.com Subject: export result from select statement Hi guys, I wonder how to store to csv or txt file result from

Re: export result from select statement

2011-01-09 Thread Michael Dykman
: Saturday, January 08, 2011 6:05 PM To: mysql@lists.mysql.com Subject: export result from select statement Hi guys, I wonder how to store to csv or txt file result from SELECT query? not a whole table nor database. Just results from SELECT query. Usually I use MySQL Query Browser and Export feature

Re: export result from select statement

2011-01-09 Thread LAMP
Eric Bergen wrote: select into outfile is the correct way. What do you mean by doesn't work? Does it give you an error? It was an issue with permissions :-) Thanks On Sat, Jan 8, 2011 at 3:04 PM, LAMP l...@afan.net wrote: Hi guys, I wonder how to store to csv or txt file result from

Re: export result from select statement

2011-01-09 Thread LAMP
[mailto:l...@afan.net] Sent: Saturday, January 08, 2011 6:05 PM To: mysql@lists.mysql.com Subject: export result from select statement Hi guys, I wonder how to store to csv or txt file result from SELECT query? not a whole table nor database. Just results from SELECT query. Usually I use MySQL Query

Re: export result from select statement

2011-01-09 Thread Yogesh Kore
. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 E-mail: je...@gii.co.jp Web site: www.the-infoshop.com -Original Message- From: LAMP [mailto:l...@afan.net] Sent: Saturday, January 08, 2011 6:05 PM To: mysql@lists.mysql.com Subject: export result from select statement Hi

export result from select statement

2011-01-08 Thread LAMP
Hi guys, I wonder how to store to csv or txt file result from SELECT query? not a whole table nor database. Just results from SELECT query. Usually I use MySQL Query Browser and Export feature, but in this case I don't have access with MySQL Query Browser. Though, I have a command line

Re: export result from select statement

2011-01-08 Thread Eric Bergen
select into outfile is the correct way. What do you mean by doesn't work? Does it give you an error? On Sat, Jan 8, 2011 at 3:04 PM, LAMP l...@afan.net wrote: Hi guys, I wonder how to store to csv or txt file result from SELECT query? not a whole table nor database. Just results from SELECT

Re: Problem with IF() inside of a select statement

2010-07-11 Thread Shawn Green (MySQL)
On 7/8/2010 10:59 AM, John Nichel wrote: Hi, I'm hoping what I'm trying to do can be done, but I can't seem to find the right syntax. I have the following query: SELECT ... snipped ... if( (

Problem with IF() inside of a select statement

2010-07-08 Thread John Nichel
products a The query is erroring out on 'd.date' in expression two of the if statement, #1109 - Unknown table 'd' in field list. Is there a way I can do a IF((SELECT.), expr2, expr3) and have expr2 populate with whatever is returned from the select statement? Thank you. -- John C. Nichel IV

Re: Problem with IF() inside of a select statement

2010-07-08 Thread Peter Brawley
Is there a way I can do a IF((SELECT.), expr2, expr3) and have expr2 populate with whatever is returned from the select statement? Yes, select if( (select count(*) from mytable ) 100, 1, 0) works fine. The alias inside your last If(...), though, is not visible outside its parentheses

RE: Problem with IF() inside of a select statement

2010-07-08 Thread John Nichel
-Original Message- From: Peter Brawley [mailto:peter.braw...@earthlink.net] Sent: Thursday, July 08, 2010 12:27 PM To: mysql@lists.mysql.com Subject: Re: Problem with IF() inside of a select statement Is there a way I can do a IF((SELECT.), expr2, expr3) and have expr2

Second Request: Challenging Select Statement

2009-12-07 Thread Victor Subervi
Hi; I posted this Saturday. Perhaps it's too challenging for those who read it to answer. I hope someone can. I need to write a select statement that enables me to select column 'ID' from a table where a certain value is found in an enum of a specific column. For example... select column_type

Re: Second Request: Challenging Select Statement

2009-12-07 Thread Tom Worster
On 12/7/09 5:26 AM, Victor Subervi victorsube...@gmail.com wrote: Hi; I posted this Saturday. Perhaps it's too challenging for those who read it to answer. I hope someone can. I need to write a select statement that enables me to select column 'ID' from a table where a certain value

Re: Second Request: Challenging Select Statement

2009-12-07 Thread Victor Subervi
On Mon, Dec 7, 2009 at 8:08 AM, Tom Worster f...@thefsb.org wrote: On 12/7/09 5:26 AM, Victor Subervi victorsube...@gmail.com wrote: Hi; I posted this Saturday. Perhaps it's too challenging for those who read it to answer. I hope someone can. I need to write a select statement

Challenging Select Statement

2009-12-05 Thread Victor Subervi
Hi; I need to write a select statement that enables me to select column 'ID' from a table where a certain value is found in an enum of a specific column. For example... select column_type from information_schema.columns where table_name='products' and column_name='Categories'; will give me

Re: Select Statement

2008-03-12 Thread Sebastian Mendel
Velen schrieb: Hi, I need to write up a select statement something like: Select a.supcode,a.code,b.desc,sum(c.qty),c.dept where a.supcode=b.supcode and a.code=c.code and a.code=b.code and c.dept between $tring1 and $tring2. group by supcode This is fine but the problem

Select Statement

2008-03-10 Thread Velen
Hi, I need to write up a select statement something like: Select a.supcode,a.code,b.desc,sum(c.qty),c.dept where a.supcode=b.supcode and a.code=c.code and a.code=b.code and c.dept between $tring1 and $tring2. group by supcode This is fine but the problem is that there is duplicate supcode

Re: Select Statement

2008-03-10 Thread Sebastian Mendel
Velen schrieb: Hi, I need to write up a select statement something like: Select a.supcode,a.code,b.desc,sum(c.qty),c.dept where a.supcode=b.supcode and a.code=c.code and a.code=b.code and c.dept between $tring1 and $tring2. group by supcode This is fine but the problem

Re: Select Statement

2008-03-10 Thread Velen
In fact my sql statement is like this: select b.customer_name Customer,a.sale_id DocNo,a.sale_date Date,a.prod_code Product,a.quantity Quantity,c.cost_price Cost,a.price Price, c.prod_description,a.store,d.payMode from sale_trans a,customer_master b,prod_master c,saletrans_cons d where

Re: Select Statement

2008-03-10 Thread Peter Brawley
Velen, My problem is that it is displaying a.sale_id but different customer_name as it is taking sale_id from d and matching cust_code with b Any non-aggregate SELECTed value that does not have a 1:1 relationship with your GROUP BY column will show arbitrary results, so the first thing to get

Re: Select Statement

2008-03-10 Thread Baron Schwartz
On Mon, Mar 10, 2008 at 1:38 PM, Peter Brawley [EMAIL PROTECTED] wrote: Velen, My problem is that it is displaying a.sale_id but different customer_name as it is taking sale_id from d and matching cust_code with b Any non-aggregate SELECTed value that does not have a 1:1 relationship

Re: Select Statement

2008-03-06 Thread Thomas Pundt
Hi, [EMAIL PROTECTED] schrieb: Hi, I have 2 tables as follows: table 1 contains code,order_qty table 2 contains code,stock_qty table 1: code1, 10 code2, 2 code3, 5 table 2: code1, 3 code3, 5 code1, 4 code3, 2 I need to see the following result: code | order_qty| stock_qty code1 | 10

Select Statement

2008-03-05 Thread velen
Hi, I have 2 tables as follows: table 1 contains code,order_qty table 2 contains code,stock_qty table 1: code1, 10 code2, 2 code3, 5 table 2: code1, 3 code3, 5 code1, 4 code3, 2 I need to see the following result: code | order_qty| stock_qty code1 | 10 | 7 code2 | 2| 0

Re: Select statement help

2008-01-18 Thread Baron Schwartz
Hi, On Jan 18, 2008 2:59 PM, RoryGRen [EMAIL PROTECTED] wrote: Hi all I am quite new to mySQL and have the following question I hope someone can help me with: I have a database table imported directly from MS Access with two of the field names having brackets - F(1) and S(1). I don't want

Select statement help

2008-01-18 Thread RoryGRen
the database needs updating. How can I select these fields from the table? - SELECT F(1), S(1) doesn't work, SELECT F(1) , S(1) doesn't work and neither does SELECT [F(1)], [S(1)] Thanks, in anticipation! Rory -- View this message in context: http://www.nabble.com/Select-statement-help

MySQL SELECT Statement with Date help request

2008-01-09 Thread Cx Cx
to 2007-03-01 db3 : 2007-03-01 to 2007-04-01 db4 : 2007-04-01 to 2007-05-01 db5 : 2007-05-01 to 2007-06-01 db6 : 2007-06-01 to 2007-07-01 I require a select statement to query all the db's to identify records with the date range for eg. 2007-02-15 to 2007-05-12. Logically this tells me

Re: MySQL SELECT Statement with Date help request

2008-01-09 Thread Brent Baisley
-01 db3 : 2007-03-01 to 2007-04-01 db4 : 2007-04-01 to 2007-05-01 db5 : 2007-05-01 to 2007-06-01 db6 : 2007-06-01 to 2007-07-01 I require a select statement to query all the db's to identify records with the date range for eg. 2007-02-15 to 2007-05-12. Logically this tells me that the databases

Can slow-query-log option only record select statement?

2007-12-20 Thread Moon's Father
I want to know how to configurate slow-query-log to let it not record the update sql. I just want to know how the slow select statement ,not the update or insert. Anybody's reply is appreciated,thanks. -- I'm a mysql DBA in china. More about me just visit here: http://yueliangdao0608.cublog.cn

Re: Question related to INSERT statement into table1 and SELECT statement from table1 to populate a column field into table1

2007-09-12 Thread Martijn Tonies
I have a table with a PRIMARY KEY on id field, whos evalue is populated usin auto_increment. CREATE TABLE `key` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `sid` smallint(4) unsigned NOT NULL DEFAULT '0', `email` varchar(128) NOT NULL DEFAULT '', PRIMARY KEY (`id`),

RE: select statement with variable for table_reference?

2007-06-28 Thread Price, Randall
] Phone: (540) 231-4396 -Original Message- From: Octavian Rasnita [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 27, 2007 2:53 PM To: Ed Lazor; Price, Randall Cc: mysql@lists.mysql.com Subject: Re: select statement with variable for table_reference? Yes it is a good idea to store in a table

Re: select statement with variable for table_reference?

2007-06-27 Thread Octavian Rasnita
@lists.mysql.com Sent: Tuesday, June 26, 2007 11:37 PM Subject: RE: select statement with variable for table_reference? Ok, I used your approach like this: -- select i.scanned_barcode, v.title from inventory as i left join version as v

RE: select statement with variable for table_reference?

2007-06-27 Thread Price, Randall
I am saying here is that the PREPARED STATEMENTS allow you to basically construct any SQL statement you want and works when you want to use a variable in places where they are usually not allowed (i.e., like table names, passing in a variable number of fields for the SELECT statement, the value

RE: select statement with variable for table_reference?

2007-06-27 Thread Ed Lazor
unions, you can do it in a final where ... that's outside of those params. Octavian - Original Message - From: Ed Lazor [EMAIL PROTECTED] To: 'Octavian Rasnita' [EMAIL PROTECTED]; mysql@lists.mysql.com Sent: Tuesday, June 26, 2007 11:37 PM Subject: RE: select statement

Re: select statement with variable for table_reference?

2007-06-27 Thread Octavian Rasnita
PROTECTED] Cc: mysql@lists.mysql.com Sent: Wednesday, June 27, 2007 8:02 PM Subject: RE: select statement with variable for table_reference? Hi Octavian, First, thanks for helping out. I really appreciate it. Thanks to you also Randall. I am not sure I understand what you want. If you want

select statement with variable for table_reference?

2007-06-26 Thread Ed Lazor
Is there a way to get something like this to work? Set @tname=mytable; Select * from @tname; Here's what I'm trying to really accomplish in case there is yet another way to approach this... I have to work with product data from multiple databases and multiple tables. For example, one database

Re: select statement with variable for table_reference?

2007-06-26 Thread Octavian Rasnita
...; Octavian - Original Message - From: Ed Lazor [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Tuesday, June 26, 2007 10:39 PM Subject: select statement with variable for table_reference? Is there a way to get something like this to work? Set @tname=mytable; Select * from @tname; Here's

RE: select statement with variable for table_reference?

2007-06-26 Thread Ed Lazor
the relevant tables... some sort of conditional union. Any ideas? -Ed -Original Message- From: Octavian Rasnita [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 26, 2007 1:02 PM To: Ed Lazor; mysql@lists.mysql.com Subject: Re: select statement with variable for table_reference? I am using

RE: select statement with variable for table_reference?

2007-06-26 Thread Jerry Schwartz
: RE: select statement with variable for table_reference? Ok, I used your approach like this: -- select i.scanned_barcode, v.title from inventory as i left join version as v on i.record_id = v.id where i.database_id = '1

RE: select statement with variable for table_reference?

2007-06-26 Thread Price, Randall
Subject: RE: select statement with variable for table_reference? Ok, I used your approach like this: -- select i.scanned_barcode, v.title from inventory as i left join version as v on i.record_id = v.id where i.database_id = '1

RE: select statement with variable for table_reference?

2007-06-26 Thread Ed Lazor
Thanks for the info Jerry. =) -Original Message- From: Jerry Schwartz [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 26, 2007 1:59 PM To: 'Ed Lazor'; 'Octavian Rasnita'; mysql@lists.mysql.com Subject: RE: select statement with variable for table_reference? Getting back to your

RE: select statement with variable for table_reference?

2007-06-26 Thread Ed Lazor
PROTECTED] Phone: (540) 231-4396 -Original Message- From: Ed Lazor [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 26, 2007 4:37 PM To: 'Octavian Rasnita'; mysql@lists.mysql.com Subject: RE: select statement with variable for table_reference? Ok, I used your approach like

SELECT statement returning columns for a given table?

2007-05-13 Thread Kelly Jones
In PostgreSQL, the following SELECT statement will return all the columns for 'tabname': SELECT x.attname FROM pg_attribute x, pg_class y WHERE x.attrelid=y.oid AND relname='tabname'; Does MySQL have anything similar? I know about SHOW COLUMNS FROM tabname, but am looking for something more

Re: SELECT statement returning columns for a given table?

2007-05-13 Thread Baron Schwartz
Hi Kelly, Kelly Jones wrote: In PostgreSQL, the following SELECT statement will return all the columns for 'tabname': SELECT x.attname FROM pg_attribute x, pg_class y WHERE x.attrelid=y.oid AND relname='tabname'; Does MySQL have anything similar? I know about SHOW COLUMNS FROM tabname

Re: SELECT statement returning columns for a given table?

2007-05-13 Thread Peter Brawley
this info, but it doesn't seem to. In 5.0 later MySQL implements the ISO SQL spec for information_schema, which does that. PB - Kelly Jones wrote: In PostgreSQL, the following SELECT statement will return all the columns for 'tabname': SELECT x.attname FROM pg_attribute x, pg_class y

Re: select statement question

2007-01-05 Thread Brent Baisley
FROM A LEFT JOIN B ON A.C=B.D WHERE B.D IS NULL - Original Message - From: Aaron Cannon [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Wednesday, January 03, 2007 3:47 PM Subject: select statement question -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all. I hope

select statement question

2007-01-03 Thread Aaron Cannon
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all. I hope this is the right place to ask this. I have two tables, A and B. Each of these tables has a column with integers. The column in table A is C and the one in B is D. I need a select statement that will return all records whose C

RE: select statement question

2007-01-03 Thread Jerry Schwartz
: select statement question -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all. I hope this is the right place to ask this. I have two tables, A and B. Each of these tables has a column with integers. The column in table A is C and the one in B is D. I need a select statement

Re: select statement question

2007-01-03 Thread Chris White
Aaron Cannon wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all. I hope this is the right place to ask this. I have two tables, A and B. Each of these tables has a column with integers. The column in table A is C and the one in B is D. SELECT c.value FROM c WHERE c.value NOT

loop through SELECT statement query results in a Trigger

2006-10-27 Thread Ferindo Middleton
properly_trained = 1; ITERATE label1; END IF; LEAVE label1; END LOOP label1; SET @x = p1; END Is this possible. Can you loop through the query results of a SELECT statement in a trigger, function, or procedure. Ferindo

Re: loop through SELECT statement query results in a Trigger

2006-10-27 Thread Waldemar Jankowski
: LOOP IF (pets row.pet_type) = 4 THEN SET properly_trained = 1; ITERATE label1; END IF; LEAVE label1; END LOOP label1; SET @x = p1; END Is this possible. Can you loop through the query results of a SELECT statement in a trigger, function, or procedure. Ferindo Check out the section

Re: Hi, newbie question on a select statement

2006-02-20 Thread sheeri kritzer
of answers, since most string comparations are donde correctly; I received both text and numbers from the monitoring tasks and wanted to keep it simple. However when I execute this select statement I am getting this problem: select info_oficina,valorSNMP from ultimas_respuestas_snmp where

Hi, newbie question on a select statement

2006-02-16 Thread Ariel Sánchez Mora
agent returns only strings and I didn't find enough a reason for converting the different types of answers, since most string comparations are donde correctly; I received both text and numbers from the monitoring tasks and wanted to keep it simple. However when I execute this select statement I am

RE: Hi, newbie question on a select statement

2006-02-16 Thread Logan, David (SST - Adelaide)
: Friday, 17 February 2006 11:29 AM To: mysql@lists.mysql.com Subject: Hi, newbie question on a select statement I searched the other lists and couldn't find one that was more appropiate for this question; if there is, please tell me so :) I am monitoring networking equipment and so far I'm saving all

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-23 Thread Grant Giddens
Thanks Hank. I'll try to split up the query into 2 separate queries. I think that the reason the original query is so slow is that I don't have enough RAM allocated to mysql. When the original query takes place, I see a process Copying to tmp table on disk. I believe it's writing all

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-23 Thread James Harvard
The reason I suggested that you just use the alternative my-huge.cnf file is because that is a ready-prepared config file optimised for systems with lots of RAM for MySQL to use. You don't need to know which variable to change - it's already done for you. You may want/need to tweak stuff later,

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-23 Thread Grant Giddens
Thanks James. I'll definately give that a try. My test server has 1 gig of ram. In the my-huge.cnf example it says that it's mainly for servers that have mysql as the main process. On my production server, I have 1 gig of ram, but it also runs apache, mutliple webstites, mysql, DNS, ftp

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-23 Thread Hank
Based on the size (and # of colums) of your result set, I'm not sure any amount of RAM would allow 360,000 records to be stored and sorted entirely in memory. After some point, mysql just decideds to use a temp table. That's the limit of my tweaking skills, so someone else is going to have to

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-22 Thread Hank
Now that I know what's causing the slow queries, what can I do to fix it? The only thing I can suggest is breaking up the query into two parts - the first part to retrieve just the product codes and salesrank, and sort and limit that.. save in a temp table or use application code to retrieve and

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-21 Thread James Harvard
statment just grabs 10 products that are associated with a specific category. The product table has 650,000 rows and the category table has 8,150,000 rows. My SELECT statement is: SELECT pn_pricecompare_catprod.category, pn_pricecompare_catprod.asin, pn_pricecompare_product.title

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-21 Thread Grant Giddens
. My SELECT statement is: SELECT pn_pricecompare_catprod.category, pn_pricecompare_catprod.asin, pn_pricecompare_product.title, pn_pricecompare_product.prod_id, pn_pricecompare_product.image_small, pn_pricecompare_product.brand, pn_pricecompare_product.manufacturer

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-21 Thread Hank
I don't think the problem is going to be solved with the my.cnf file. Here's what I would try.. 1- run and time the original query without the ORDER BY or LIMIT clauses 2- run and time the following breakdown queries, to see if the indexes are at least working correctly: -- test catprod

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-21 Thread Grant Giddens
Thank Hank. I will try this. When you say the table descriptions, do you mean for me to post my CREATE TABLE syntax of how I created the table? Thanks, Grant Hank [EMAIL PROTECTED] wrote: I don't think the problem is going to be solved with the my.cnf file. Here's what I would

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-21 Thread James Harvard
That's why I suggested simply using the supplied my-huge.cnf config file, because I assume it was contructed by some MySQL uber-guru who does know how much RAM to allocate to each variable! James Harvard Like I mentioned before, I am tweaking the .cnf files by blind trial and error. I

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-21 Thread Hank
Grant, You can just to a desc pn_pricecompare_catprod and desc pn_pricecompare_product and post the results. The CREATE TABLE statements would be OK, but the describes are better. The flush the query cache, I think if you do a flush tables. -Hank -- MySQL General Mailing List For list

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-21 Thread SGreen
Hank [EMAIL PROTECTED] wrote on 12/21/2005 09:39:50 AM: Grant, You can just to a desc pn_pricecompare_catprod and desc pn_pricecompare_product and post the results. The CREATE TABLE statements would be OK, but the describes are better. The flush the query cache, I think if you do a

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-21 Thread Grant Giddens
OK guys, Here is are my tables and test SELECT queries. Before every query I did a FLUSH TABLES command. Before starting these test, I did and ANALYIZE and OPTIMIZE on all the tables. Hopefully the formatting of this email isn't too bad. product table: show create table

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-21 Thread Hank
Ok, so the next step would be to try the original query with just the LIMIT clause, and then just the ORDER BY (but not both). The results of select count(*) query would be helpful to know just how many records mysql is trying to sort and limit. And do you really need a separte index key on

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-21 Thread Grant Giddens
It'll be a few hours before I get home and can do this query with the variations you mentioned. I don't know if I need the separate index key on `salesrank` or not. I thought it would speed up my query be having it. In the previous email I included the results from doing an EXPLAIN.

Re: Do I need to tweak my server variables for this SELECT statement?

2005-12-21 Thread Grant Giddens
OK, I tried the following queries: 1. Use the ORDER BY and not the LIMIT -- still slow 2. Use the LIMIT and not the ORDER BY -- fast So it looks like it's building a whole temp table with all the items and then doing the ORDER BY. Just as a test, I removed the INDEX

Do I need to tweak my server variables for this SELECT statement?

2005-12-20 Thread Grant Giddens
category. The product table has 650,000 rows and the category table has 8,150,000 rows. My SELECT statement is: SELECT pn_pricecompare_catprod.category, pn_pricecompare_catprod.asin, pn_pricecompare_product.title, pn_pricecompare_product.prod_id, pn_pricecompare_product.image_small

Re: Commit needed even after a select statement ??

2005-08-19 Thread Jasper Bryant-Greene
Sujay Koduri wrote: hi, i am using MysQL4.1.13. I tried doing the following. * Open a new session to DB. (Say session 1) * Using prepared statements provided by C API, issued a select statement to get some rows from a table. * This worked absolutely fine. * I didnt

RE: Commit needed even after a select statement ??

2005-08-19 Thread Sujay Koduri
No I am performing the second select Query only. I am including the pseudo code which I am trying to do. Pseudo code Establish a connection to DB Get statement handler While(conditon) { Prepare a select statement. Bind input variable. Execute the statement. Bind o/p vars. Fetch results. Wait

Re: Commit needed even after a select statement ??

2005-08-19 Thread Philippe Poelvoorde
HI, n(say session 2) and updated the entries in the table. Did a commit. * Now i issued the second select statement on session 1, but still it is showing the old results. Idealy it should show the new results, which are a result of updations done using session 2. But when i issue a commit

RE: Commit needed even after a select statement ??

2005-08-19 Thread Sujay Koduri
Thanks a lot Philippe. Its working. :) sujay -Original Message- From: Philippe Poelvoorde [mailto:[EMAIL PROTECTED] Sent: Friday, August 19, 2005 12:43 PM To: 'mysql@lists.mysql.com ' Subject: Re: Commit needed even after a select statement ?? HI, n(say session 2) and updated

Commit needed even after a select statement ??

2005-08-18 Thread Sujay Koduri
hi, i am using MysQL4.1.13. I tried doing the following. * Open a new session to DB. (Say session 1) * Using prepared statements provided by C API, issued a select statement to get some rows from a table. * This worked absolutely fine. * I didnt close the session

Call a function from a select statement?

2005-05-31 Thread Scott Klarenbach
Is this not the proper way to use a function in a select statement? SELECT t.field1, t.field2, functionPerformAdditionalQueryFromField(t.field2) AS 'customField' FROM Table t I'd like to perform the function on every row in the result set, and store the returned value of that function in EACH

RE: Call a function from a select statement?

2005-05-31 Thread Dathan Pattishall
- From: Scott Klarenbach [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 31, 2005 10:58 AM To: My SQL Subject: Call a function from a select statement? Is this not the proper way to use a function in a select statement? SELECT t.field1, t.field2

Re: Call a function from a select statement?

2005-05-31 Thread Scott Klarenbach
10:58 AM To: My SQL Subject: Call a function from a select statement? Is this not the proper way to use a function in a select statement? SELECT t.field1, t.field2, functionPerformAdditionalQueryFromField(t.field2) AS 'customField' FROM Table t I'd like to perform

RE: using if in select statement

2005-04-29 Thread mathias fatene
@lists.mysql.com ' Subject: re: using if in select statement -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 My boss and I were playing with using select statements, and we can actually execute subqueries as an option if the result is true or false. Is this expected behavior, or is it something that may be fixed

re: using if in select statement

2005-04-28 Thread James Black
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 My boss and I were playing with using select statements, and we can actually execute subqueries as an option if the result is true or false. Is this expected behavior, or is it something that may be fixed in a revision, before I begin to depend on it

INSERT ... SELECT statement

2005-01-21 Thread Stefano Giorgetti
I need to execute an INSERT...SELECT query. INSERT HIGH_PRIORITY INTO stations_data (station_id, Tmin, Tmax, Tmed, RHmin, RHmax, RHmed, rain, Wmax, slpres, insertion_date) ( SELECT stations.station_id AS stId, min(stations_rt_data.T) AS tmax,

Select Statement Query

2004-11-09 Thread Kory Wheatley
I'm trying to do a select statement where: field targetApp equals the value acadreg and field accessed equals the value Y and filed enteredQue is like 2004-11-09 18% the whole enterqueue fieild is something like 2004-11-09 16:00:34 Here's what I'm trying to accomplish, I want to get all

Re: Select Statement Query

2004-11-09 Thread Michael Stassen
How about SELECT * FROM queLog WHERE accessed = Y AND targetApp = acadreg AND enteredQue = '2004-11-09 18:00:00'; (You said greater than first, then you said greater than or equal to. I went with the latter.) Michael Kory Wheatley wrote: I'm trying to do a select statement where: field

Re: Dumping Select statement output onto a text file

2004-10-29 Thread Andy Davidson
On 29 Oct 2004, at 00:37, Mulley, Nikhil wrote: How do I dump the data from console to the text file from the output generated by SELECT statement ? If it's a small answer that you're just trying to save to a file for note-keeping purposes, you could run mysql -e 'select * from thing where foo

Dumping Select statement output onto a text file

2004-10-28 Thread Mulley, Nikhil
Hi List, How do I dump the data from console to the text file from the output generated by SELECT statement ? Thanks, Nikhil.

  1   2   3   4   >