Re: help me optimize this "ALL"

2007-03-05 Thread wangxu
thank you - Original Message - From: "Jay Pipes" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: Sent: Tuesday, March 06, 2007 4:29 AM Subject: Re: help me optimize this "ALL" > No, because you have no WHERE condition. >

Re: help me optimize this "ALL"

2007-03-05 Thread Jay Pipes
No, because you have no WHERE condition. wangxu wrote: > sql: > > SELECT * > FROM table_one INNER JOIN table_one table_one1 ON table_one1.column_one = > table_one.column_two >INNER JOIN table_one table_one2 ON table_one2.column_one = > table_one.column_three

Re: Help indexing this query.

2007-01-22 Thread altendew
Thanks for the casting tip. Dan Buettner-2 wrote: > > Andrew, couple of suggestions: > > 1 - where you use > s.status='2' > change it to > s.status=2 > otherwise MySQL is likely casting your data from int to string, which > is slow and also precludes using an index. > > 2 - in this case, inst

Re: Help indexing this query.

2007-01-22 Thread Dan Buettner
Andrew, couple of suggestions: 1 - where you use s.status='2' change it to s.status=2 otherwise MySQL is likely casting your data from int to string, which is slow and also precludes using an index. 2 - in this case, instead of using a left join, try using a subquery: WHERE ... AND s.mid NOT IN

Re: Help indexing this query.

2007-01-22 Thread altendew
--- EXPLAIN --- 1 SIMPLE e system cid NULL NULL NULL 0 const row not found 1 SIMPLE s ref sid,status,timeframe status 4 const 20438 Using where; Using temporary; Using filesort 1 SIMPLE m eq_ref PRIMARY,status PRIMARY 4 sc_72.s.mid 1 Using where --- members --- id int(20) No first varchar

Re: Help indexing this query.

2007-01-22 Thread Dan Buettner
Andrew, can you post the result of EXPLAIN for your query? Minus the "FORCE INDEX" too. Also the structure of the other 2 tables would be helpful as well. Thanks, Dan On 1/22/07, altendew <[EMAIL PROTECTED]> wrote: --- ptsSignups -- id int(20) No mid int(20) No 0 ptsID int(20) No 0 pps dou

RE: Help me to understand multiple locking the same tables (lock; lock; unlock)

2007-01-10 Thread Jerry Schwartz
Yes, the two examples are equivalent. "UNLOCK TABLES releases any locks held by the current thread. All tables that are locked by the current thread are implicitly unlocked when the thread issues another LOCK TABLES..." So there is a hole there with either example. In order to keep others from ch

Re: Help optimizing this query?

2007-01-08 Thread joce
Hi, I would use a (source,stamp) index, and not a (stamp,source) index to solve the performance problem. Jocelyn Fournier www.mesdiscussions.net > Brian, can you post the output of EXPLAIN for your query? > I.e., > EXPLAIN ; > > > At first glance, your query should be able to use the 'stamp

Re: Help optimizing this query?

2007-01-08 Thread Dan Buettner
Brian, can you post the output of EXPLAIN for your query? I.e., EXPLAIN ; At first glance, your query should be able to use the 'stamp-source' index since stamp is the first column indexed. However, I wonder if wrapping the "NOW() - INTERVAL 14 DAY inside a "DATE()" would help. MySQL may be ca

RE: Help optimizing this query?

2007-01-08 Thread Michael Gargiullo
-Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Sunday, January 07, 2007 1:12 PM To: mysql Subject: Help optimizing this query? This is the query that's killing me in the slow query log, usually taking around 20 seconds: select count(ip) as counted,stamp from i

Re: Help optimizing this query?

2007-01-07 Thread Daniel Kasak
Brian Dunning wrote: This is the query that's killing me in the slow query log, usually taking around 20 seconds: select count(ip) as counted,stamp from ip_addr where stamp>=NOW()-interval 14 day and source='sometext' group by stamp order by stamp desc; Here is the table: CREATE TABLE `ip_

Re: Help: Installation problem

2006-12-13 Thread Chris
VeeJay wrote: I am a novice with Unix and user of MySQL on windows….. I have a problem, i.e. I want to install MySQL5.0 at my FreeBSD 6.1 box with following configurations: --prefix=/usr/local/mysql --with-mysqld-user=mysql --with-unix-socket-path=/tmp/mysql.sock --with-mysqld-ldflags

Re: Help understanding the whole password issue

2006-11-28 Thread Eric Bergen
Mathieu, The old_passwords option only changes how mysqld generates new passwords. If old_passwords=0 when you create a new user mysql will generate a long password that will only accept clients using the newer protocol (and client lib). When old_passwords=1 mysql will generate the older shorter

Re: Help understanding the whole password issue

2006-11-28 Thread Mathieu Bruneau
I may not be totally right but : 1) Well it all depends of which client library they are using if they are using the old library yes 2) Well if that client use the old libraby yes ... (btw you can check the password field in the mysql.user table to view the difference => they have a different for

Re: help trying to add an autoincrement col to an exisiting table

2006-11-02 Thread Rolando Edwards
You are better off doing the following DROP TABLE IF EXISTS users_new; CREATE TABLE users_new ( uname varchar(20) NOT NULL default '', passwd varchar(15) NOT NULL default '', fname varchar(25) NOT NULL default '', lname varchar(40) NOT NULL default '', dir varchar(28) NOT NULL default ''

RE: help with query: select customers that ARO NOT in orders t

2006-10-23 Thread Waldemar Jankowski
20, 2006 1:53 PM To: [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Subject: Re: help with query: select customers that ARO NOT in orders table On Fri, 20 Oct 2006, [EMAIL PROTECTED] wrote: hi to all, I have table customers (PK cust_id) I have table orders (PK order_id, FK cust_id) I need query t

RE: help with query: select customers that ARO NOT in orders table

2006-10-23 Thread Jerry Schwartz
, CT 06032 860.674.8796 / FAX: 860.674.8341 > -Original Message- > From: Waldemar Jankowski [mailto:[EMAIL PROTECTED] > Sent: Friday, October 20, 2006 1:53 PM > To: [EMAIL PROTECTED] > Cc: mysql@lists.mysql.com > Subject: Re: help with query: select customers that ARO NOT

Re: help with query: select customers that ARO NOT in orders table

2006-10-20 Thread Waldemar Jankowski
On Fri, 20 Oct 2006, [EMAIL PROTECTED] wrote: Ok. Just found I gave wrong info. To make my life easier, the person who created db named cust_id in 'orders' table as SoldTo [EMAIL PROTECTED] in this case, select cust_id from customers where cust_id not in (select Soldto from orders); will no

Re: help with query: select customers that ARO NOT in orders table

2006-10-20 Thread afan
Ok. Just found I gave wrong info. To make my life easier, the person who created db named cust_id in 'orders' table as SoldTo [EMAIL PROTECTED] in this case, select cust_id from customers where cust_id not in (select Soldto from orders); will not work :( > On Fri, 20 Oct 2006, [EMAIL P

Re: help with query: select customers that ARO NOT in orders table

2006-10-20 Thread Waldemar Jankowski
On Fri, 20 Oct 2006, [EMAIL PROTECTED] wrote: hi to all, I have table customers (PK cust_id) I have table orders (PK order_id, FK cust_id) I need query that will selecct all customers from 'customers' they don't have any order, there is not their cust_id in 'orders'. couls somebody help me? t

Re: help with update query

2006-10-16 Thread Ferindo Middleton
r table. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 > -Original Message- > From: Ferindo Middleton [mailto:[EMAIL PROTECTED] > Sent: Saturday, October 14, 2006 9:16 PM > To: Dan Buettner > Cc: my

RE: help with update query

2006-10-16 Thread Jerry Schwartz
ble. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 > -Original Message- > From: Ferindo Middleton [mailto:[EMAIL PROTECTED] > Sent: Saturday, October 14, 2006 9:16 PM > To: Dan Buettner > Cc

Re: Re: help with update query

2006-10-14 Thread Dan Buettner
Good call on the WHERE email_address IS NULL thing. Also occurs to me you could do a SELECT DISTINCT instead of just a SELECT to eliminate duplicate update commands. Glad this was useful. Dan On 10/14/06, Ferindo Middleton <[EMAIL PROTECTED]> wrote: Thanks Dan. This does help. This a pretty

Re: help with update query

2006-10-14 Thread Ferindo Middleton
Thanks Dan. This does help. This a pretty straight-forward idea. I could even save the results of this query to a text file and possibly review it a little before running it so I don't acidentally do anything funky and I could see the impact this would have on the data before applying it. I think

Re: help with update query

2006-10-14 Thread Dan Buettner
Ferindo, I had a similar task recently, and the problem you'll run into is that you can't select from and update the same table at once. What I ended up doing was doing a SELECT to build the update queries for me. Something like this: SELECT CONCAT( "UPDATE bowler_score SET email_address = '", em

Re: Help with SQL Queries

2006-10-04 Thread Johan Höök
Hi, I'm including your post to the forum as well. The problem I think is the fact that you need to do LEFT JOIN in two directions which quite often don't turn out what you want. So what you can do is to do two queries, UNION them together and form a derived table that you then do your final SELECT

Re: Help with SQL Queries

2006-10-04 Thread Yashesh Bhatia
hey thx for the reply.. here's my query.. http://forums.mysql.com/read.php?20,119150,119150#msg-119150 thx. yashesh bhatia. On 10/4/06, Rob Desbois <[EMAIL PROTECTED]> wrote: Yes, ask away :) > Hi, Is the the right group to post for questions with SQL Queries ? thx. yashesh bhatia --

re: Help with SQL Queries

2006-10-04 Thread Rob Desbois
Yes, ask away :) > Hi, Is the the right group to post for questions with SQL Queries ? thx. yashesh bhatia -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] _

RE: Help ERROR 2002

2006-10-03 Thread nngau
Okay all seems to be fine now. All I did was restart the server for the 2nd time And now it seems to connect to mysql. Whew! I was starting to panic there. -Original Message- From: nngau [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 03, 2006 3:42 PM To: mysql@lists.mysql.com Subject:

RE: Help for query

2006-09-26 Thread Jerry Schwartz
n Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 -Original Message- From: Xiaobo Chen [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 26, 2006 10:09 AM To: [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Subject: Re: Help for query I found if I divided into 2 steps, I will find the reco

Re: Help for query

2006-09-26 Thread Xiaobo Chen
I found if I divided into 2 steps, I will find the record in table B: Ta - the given timestamp from table A; 1) select min(abs(Ta - timestamp)) as min_t from B; 2) select * from B where (timestamp + min_t = Ta) or (timestamp - min_t = Ta); But, how can I make these 2 steps into 1 query? Thanks

RE: Help for query

2006-09-26 Thread Xiaobo Chen
Global Information Incorporated > 195 Farmington Ave. > Farmington, CT 06032 > > 860.674.8796 / FAX: 860.674.8341 > > -Original Message- > From: Xiaobo Chen [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 26, 2006 10:09 AM > To: [EMAIL PROTECTED] > Cc: mysql@lists.mys

Re: Help with query

2006-09-26 Thread Visolve DB Team
Hi, Try with FULLTEXT search. Alter the table to make the search columns as FULLTEXT columns, with MyISAM engine and retrieve the records using MATCH keyword. Ref:http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html Thanks, ViSolve DB Team. - Original Message - From: "Ed Curt

RE: Help with query

2006-09-25 Thread Jerry Schwartz
Have you dumped out your variables to make sure none of them is a zero-length string? That would surely cause your problem. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 -Original Message- From: Ed Curt

RE: help with insert +php

2006-09-02 Thread Dinçer Akay
Hi, Protect your database http://www.php.net/manual/en/function.htmlspecialchars.php PHP Security Consortium http://phpsec.org/ Protect SQL Injection Attack See more http://www.php.net/manual/en/function.mysql-real-escape-string.php The query sent to

Re: help with insert +php

2006-09-01 Thread Gaston Sebastian Marengo
#x27;email1'],$_post['email2'],$_POST['$web'],$_POST['casilla'],$_POST['observaciones'])"; -Original message----- From: Marcelo Fabiani [EMAIL PROTECTED] Date: Fri, 01 Sep 2006 15:27:19 -0300 To: Jerry Schwartz [EMAIL PROTECTED] Subject: Re: h

Re: help please, help please

2006-09-01 Thread Dave Heath
I am not able to install Mysql on my 2003 server at home. error 1045!! I get an accesd denied for user [EMAIL PROTECTED] I need the full error, but have some questions: 1. Are you sure that you set a root password? 2. Are you using the command line client or some other administrative tool?

Re: help with insert +php

2006-09-01 Thread Marcelo Fabiani
Chris W escribió: Marcelo Fabiani wrote: Here is the code: . . . $result = mysql_query($sq)or die ("problema Leyendo Tabla");; . . . Why are there two ; at the end of that line? I'm really not sure what if anything that will do but I would remove it just in case. Also are there an

Re: help with insert +php

2006-09-01 Thread Chris W
Marcelo Fabiani wrote: Here is the code: . . . $result = mysql_query($sq)or die ("problema Leyendo Tabla");; . . . Why are there two ; at the end of that line? I'm really not sure what if anything that will do but I would remove it just in case. Also are there any triggers on this

Re: help with insert +php

2006-09-01 Thread Marcelo Fabiani
John Meyer escribió: Try this $retval = mysql_query($sql) or die(mysql_error()) To at least get an idea of what MySQL thinks is the error. The is no error in the insert it adds the row, but in addition add's two more rows with no data, only the auto_increment ; Example: Adds 1 Marcelo

Re: help with insert +php

2006-09-01 Thread dpgirago
> [EMAIL PROTECTED] escribió: >> Marcelo, >> >> The usual advice is to echo out the query string and examine it for syntax. >> Assuming it has form data in it for the variables, then try copying/pasting >> it into the mysql client and run it from there. Let us know how that goes. >> >> David >> >

Re: help with insert +php

2006-09-01 Thread Marcelo Fabiani
[EMAIL PROTECTED] escribió: Marcelo, The usual advice is to echo out the query string and examine it for syntax. Assuming it has form data in it for the variables, then try copying/pasting it into the mysql client and run it from there. Let us know how that goes. David Already done that

Re: help with insert +php

2006-09-01 Thread dpgirago
Marcelo, The usual advice is to echo out the query string and examine it for syntax. Assuming it has form data in it for the variables, then try copying/pasting it into the mysql client and run it from there. Let us know how that goes. David -- MySQL General Mailing List For list archives:

Re: help with insert +php

2006-09-01 Thread Marcelo Fabiani
Jerry Schwartz escribió: I don't see the form. Unless one of your included files sets the values of your variables, this code will insert a row of empty strings every time it executes. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.879

RE: help with insert +php

2006-09-01 Thread Jerry Schwartz
I don't see the form. Unless one of your included files sets the values of your variables, this code will insert a row of empty strings every time it executes. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 ---

Re: Help Thanks!

2006-08-22 Thread obed
On 8/22/06, Karl Larsen <[EMAIL PROTECTED]> wrote: $ mysqladmin -U make new password for root doesn't work. can you copy the error? if you want to set the root password you can use mysqladmin -u root password "newpwd" -- http://www.obed.org.mx ---> blog -- MySQL General Mailing List For li

Re: HELP!

2006-08-22 Thread Jørn Dahl-Stamnes
On Tuesday 22 August 2006 10:37, Peter Lauri wrote: > Don't have any recent, or actually I do not know, because I am not in > charge of the hosting part of this, only access to upload scripts and > control MySQL via phpMyAdmin. > > :( A good backup is always a good thing. I dump my databases every

Re: HELP!

2006-08-22 Thread Adrian Bruce
Not the best start to the day, if you have a fairly recent backup and have enabled binary logging then you can recover up to the point before you screwed the data. Peter Lauri wrote: Hi, I did something terrible similar to UPDATE table SET testdate=NOW() And I kind of forgot the WHER

RE: HELP!

2006-08-22 Thread Peter Lauri
PM To: mysql@lists.mysql.com Subject: Re: HELP! On Tuesday 22 August 2006 10:29, Peter Lauri wrote: > Hi, > I did something terrible similar to UPDATE table SET testdate=NOW() > And I kind of forgot the WHERE lalalala, so now all my records are screwed. > Is there any way of actu

Re: HELP!

2006-08-22 Thread Patrik Wallstrom
On Tue, 22 Aug 2006, Peter Lauri wrote: > Hi, > > I did something terrible similar to UPDATE table SET testdate=NOW() > > And I kind of forgot the WHERE lalalala, so now all my records are screwed. > > Is there any way of actually undoing this? :) Recover from your backup. -- patrik_wallstro

Re: HELP!

2006-08-22 Thread Jørn Dahl-Stamnes
On Tuesday 22 August 2006 10:29, Peter Lauri wrote: > Hi, > I did something terrible similar to UPDATE table SET testdate=NOW() > And I kind of forgot the WHERE lalalala, so now all my records are screwed. > Is there any way of actually undoing this? :) Backup? -- Jørn Dahl-Stamnes homepage: htt

Re: Help with query

2006-08-21 Thread Jesse
. I really appreciate your help. Jesse - Original Message - From: Douglas Sims To: Jesse Cc: MySQL List Sent: Monday, August 21, 2006 12:07 PM Subject: Re: Help with query I think you are trying to use a regular expression in the like phrase. I wasn't aware that MS SQL

Re: Help with query

2006-08-21 Thread Douglas Sims
I think you are trying to use a regular expression in the like phrase. I wasn't aware that MS SQL can do regular expressions at all? I've been using 2000 - perhaps the newer version can? In MySQL, instead of saying: LA.LastName LIKE '[A-E]%' try this: LA.LastName REGEXP '^[A-E]' You can

Re: HELP needed for speeding up a query!

2006-08-20 Thread Chris
[ always cc the list so others can share the fix or make appropriate comments ] Nicholas Wyatt wrote: hi chris, thanks for answering! however, i do already have indexes on those columns. all my tables use the myisam storage engine. what are the differences you mentioned between these engines w

Re: HELP needed for speeding up a query!

2006-08-20 Thread Chris
Nicholas Wyatt wrote: Hello to all! has anybody got any ideas how i can speed up the following query? it's so awfully slow (about 1 second). the "test_item" table is the main problem. currently, it has about 108.000 entries. is it normal that it takes so long? and if it isn't, how can i optimi

Re: help needed to mount data from /var/lib/mysql

2006-08-19 Thread balaraju mandala
if i search for any process running i am getting following thing. [EMAIL PROTECTED] mysql]# ps -ef | grep mysqld root 18389 1 0 13:09 pts/300:00:00 /bin/sh /usr/bin/mysqld_safe --defaults-file=/etc/my.cnf --pid-file=/var/run/mysqld/mysqld.pid mysql18422 18389 0 13:09 pts/300

Re: help needed to mount data from /var/lib/mysql

2006-08-19 Thread balaraju mandala
I am unable to start server after shifting to new location. i tried to start 'mysqld' but it was failed. A blank mysql.sock file is creating. Entries of log files are also not reporting any problem.

Re: help needed to mount data from /var/lib/mysql

2006-08-19 Thread balaraju mandala
Hi All, Thank you for u r reply. But i am unable to find my.cnf, is i need to create this file.

Re: help needed to mount data from /var/lib/mysql

2006-08-19 Thread ViSolve DB Team
Hello, You can change the MySQL data path in /etc/my.cnf by editing the configuration parameter "datadir" with new data path. Once you done the changes in my.cnf, reboot the MySQL server. Thanks, ViSolve DB Team - Original Message - From: "balaraju mandala" <[EMAIL PROTECTED]> To

Re: help needed to mount data from /var/lib/mysql

2006-08-19 Thread chris smith
On 8/19/06, balaraju mandala <[EMAIL PROTECTED]> wrote: Hi Everybody, I need small help from you. In my Linux box i have limitation of Size in partition. I have only 5 GB space for /var. MySQL is installed in this partition only. I want to give another path like /home, where i have 120GB of spac

Re: Help: PHP won't connect to MySQL

2006-07-17 Thread Chris
Kay C. Tien wrote: At 05:37 PM 7/17/2006 Monday, Chris wrote: Kay C. Tien wrote: Hi All, The simple script I'm testing works on a Linux server. I got tired of having to upload and test them, so I decided to install MySQL on my computer, which is running Win XP. MySQL works fine on it's own,

Re: Help: PHP won't connect to MySQL

2006-07-17 Thread Kay C. Tien
At 05:37 PM 7/17/2006 Monday, Chris wrote: Kay C. Tien wrote: Hi All, The simple script I'm testing works on a Linux server. I got tired of having to upload and test them, so I decided to install MySQL on my computer, which is running Win XP. MySQL works fine on it's own, I've set the the dat

Re: Help: PHP won't connect to MySQL

2006-07-17 Thread Kay C. Tien
At 05:37 PM 7/17/2006 Monday, Chris wrote: Kay C. Tien wrote: Hi All, The simple script I'm testing works on a Linux server. I got tired of having to upload and test them, so I decided to install MySQL on my computer, which is running Win XP. MySQL works fine on it's own, I've set the the dat

Re: Help: PHP won't connect to MySQL

2006-07-17 Thread Chris
Kay C. Tien wrote: Hi All, The simple script I'm testing works on a Linux server. I got tired of having to upload and test them, so I decided to install MySQL on my computer, which is running Win XP. MySQL works fine on it's own, I've set the the database and etc., but nothing happened whe

Re: help with locate() function and index

2006-06-24 Thread kevin vicky
Hi, The table has ~2 million records and has 3 columns one of which is a text field which on an average has 2000 characters(English alphabets, space are there for now, but if required can be eliminated). eg: "adfastsdfasgadfdfdsaffagdasfd adfsadfadsgdsfdfsdfsgsdfdsg fg adfafg adfddfgadsfdsgfghfg

Re: help with locate() function and index

2006-06-23 Thread John Hicks
kevin vicky wrote: Hi, I am trying to use locate() function to get position of a substring in a text field which on average has 2000 characters and the search substring is 30 -50 characters long. The table has around 2 million records and looking for a efficient way to do the search. I tried ful

Re: help with storing a large binary number as bigint

2006-06-02 Thread Jeremy Cole
Hi Byron, This should be a relatively simple question but after looking through the manual for a while I didn't see how to do it. I am working in php and need to store a large binary number in the database. When I try and convert it to a int in php its too big so it converts it to a float and I

Re: help on SQL JOIN

2006-06-02 Thread Peter Brawley
Nhadie, ...what i want to actually achieve is to get only the time of the first INVITE and then it's corresponding BYE so it should look like this +--+--+--+--+--+--+ | username | t1method | t2method | start| stop | timediff | +-

Re: Help with query: Row number / Rank from a query...

2006-06-02 Thread Dan
Thanks Peter, That looks pretty good to me. I never would have figured that out on my own. Dan T On Jun 1, 2006, at 4:06 PM, Peter Brawley wrote: Dan, >I want to get a particular users 'rank' or row number from the query. SELECT 1+COUNT(*) AS Rank FROM results r1 INNER JOIN results r2 O

Re: help with storing a large binary number as bigint

2006-06-01 Thread Sameer
You could use the mysql CAST or CONVERT functions Byron.Albert wrote: Hey all, This should be a relatively simple question but after looking through the manual for a while I didn't see how to do it. I am working in php and need to store a large binary number in the database. When I try and co

Re: Help with query: Row number / Rank from a query...

2006-06-01 Thread Peter Brawley
Dan, >I want to get a particular users 'rank' or row number from the query. SELECT 1+COUNT(*) AS Rank FROM results r1 INNER JOIN results r2 ON r1.points I have a regular query lets say: SELECT user, points FROM results ORDER BY points DESC so I get: userpoints --- john23 s

Re: Help with query: Row number / Rank from a query...

2006-06-01 Thread Michael Stassen
Dan wrote: I have a regular query lets say: Better to show the real query, rather than a simplified version. Simplified requests get you simplified answers. What seems like a simplification to you, may in fact hide a crucial piece of information, thus preventing anyone from giving you a so

Re: Help on VB and ODBC

2006-05-04 Thread C.R.Vegelin
Hi Manuel, I had a similar problem a few months ago and I found 'somewhere' in the documentation a post by Matthew van Os on May 27 2005, saying: The CursorLocation should be of the type "adUseClient" instead of "adUseServer". The adUseServer returns a -1 as recordcount. The adUseClient retur

Re: Help with this query. How to do a group by on a datetime just the month/day/year

2006-05-03 Thread BJ Swope
select count(*), substring(timeofclick,1,7) from MTracking where mallarea=1001 group by 2; On 5/3/06, Randy Paries <[EMAIL PROTECTED]> wrote: Hello, Not sure if i can do this. I have a table with a datetime column I would like to do group by a day of the month. if i do something like sel

RE: Help with this query. How to do a group by on a datetime just the month/day/year

2006-05-03 Thread George Law
try: group by substring(timeofclick,1,10) -Original Message- From: Randy Paries [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 11:25 AM To: mysql@lists.mysql.com Subject: Help with this query. How to do a group by on a datetime just the month/day/year Hello, Not sure if i ca

Re: HELP --- Slow SP

2006-05-02 Thread Hardi OK
Guys, So many thanks for you kind help. I was able to find the culprit, just adding 1 index i can get as fast as 30 thousands record per hour. So that I can proccess 2 million data in about 4 days only. But now, after my main tables loaded with more than 2 million data (2,9 million), i have an

RE: HELP --- Slow SP

2006-05-01 Thread Quentin Bennett
bject: Re: HELP --- Slow SP > > CREATE TABLE `his_msisdn_imei_activ_hist` ( > > `MSISDN` varchar(23) NOT NULL, > > `ACTIV_IMEI` varchar(20) NOT NULL, > > `ACTIV_PHONE_TYPE` varchar(100) NOT NULL, > > `PREV_IMEI` varchar(20) default NULL, > > `PREV_PHONE_TYPE` v

RE: Help with subqueries... MAX() and GROUP BY [sovled]

2006-04-29 Thread Shawn Green
--- Daevid Vincent <[EMAIL PROTECTED]> wrote: > Well I think this is mostly working. I have a 'NULL' user ID which is > 'system' that I need to get into here, but I think I'm mostly on > track... > > There are lots of ways to accomplish this task it seems. ALL of which > would > be so much easi

RE: Help with subqueries... MAX() and GROUP BY

2006-04-28 Thread Pat Adams
On Fri, 2006-04-28 at 00:13 -0700, Daevid Vincent wrote: > The problem is now that I can't get the right data. > > mysql> select max(created_on), user_id, id from logs group by user_id; > +-+-++ > | max(created_on) | user_id | id | > +-+

RE: Help with subqueries... MAX() and GROUP BY [sovled]

2006-04-28 Thread Daevid Vincent
| | 431 | 2 | 2006-04-27 22:18:35 | Viewed Users Stats | bob | +-+-+-++--+ From: Alex Arul [mailto:[EMAIL PROTECTED] Sent: Friday, April 28, 2006 2:18 AM To: D

Re: HELP --- Slow SP

2006-04-28 Thread Martijn Tonies
> > CREATE TABLE `his_msisdn_imei_activ_hist` ( > > `MSISDN` varchar(23) NOT NULL, > > `ACTIV_IMEI` varchar(20) NOT NULL, > > `ACTIV_PHONE_TYPE` varchar(100) NOT NULL, > > `PREV_IMEI` varchar(20) default NULL, > > `PREV_PHONE_TYPE` varchar(100) default NULL, > > `ACTIV_TIME` datetime NOT NULL, > >

RE: Help with subqueries... MAX() and GROUP BY

2006-04-28 Thread Daevid Vincent
> Thanks Alex, that got me started. I don't understand why I > had to use "IN" > when the example uses "=" but at least it kinda works... > > The problem is now that I can't get the right data. > > mysql> select max(created_on), user_id, id from logs group by user_id; > +-+-

RE: Help with subqueries... MAX() and GROUP BY

2006-04-28 Thread Daevid Vincent
> -Original Message- > From: Alex Arul [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 27, 2006 11:28 PM > To: Daevid Vincent > Cc: mysql@lists.mysql.com > Subject: Re: Help with subqueries... > > On 4/28/06, Daevid Vincent <[EMAIL PROTECTED]> wrote: &

Re: Help with subqueries...

2006-04-27 Thread Alex Arul
On 4/28/06, Daevid Vincent <[EMAIL PROTECTED]> wrote: > > vmware reviewit # mysql --version > mysql Ver 14.12 Distrib 5.0.19, for pc-linux-gnu (i686) using readline > 5.1 > > Given two tables: > > CREATE TABLE `logs` ( > `id` bigint(20) unsigned NOT NULL auto_increment, > `user

RE: HELP --- Slow SP

2006-04-27 Thread Quentin Bennett
Bennett; mysql@lists.mysql.com Subject: Re: HELP --- Slow SP Hi, When I used the EXPLAIN command, i see that all of my query are using the correct index. That's why i was quite sure that index won't be the cause of my slow query problem. So, i now should alter the table: remove prima

Re: HELP --- Slow SP

2006-04-27 Thread Daniel Kasak
Hardi OK wrote: Hi, When I used the EXPLAIN command, i see that all of my query are using the correct index. That's why i was quite sure that index won't be the cause of my slow query problem. So, i now should alter the table: remove primary key and recreate index? If your queries are us

Re: HELP --- Slow SP

2006-04-27 Thread Hardi OK
Hi, When I used the EXPLAIN command, i see that all of my query are using the correct index. That's why i was quite sure that index won't be the cause of my slow query problem. So, i now should alter the table: remove primary key and recreate index? Many thanks, Hardi On 4/28/06, Daniel Kasak

Re: HELP --- Slow SP

2006-04-27 Thread Daniel Kasak
Quentin Bennett wrote: I think that you can use the left most columns of the index, without including the remainder. That's wasn't my understanding of how things work, but I've just checked the documentation, and it looks like you're right: MySQL cannot use a partial index if the colum

RE: HELP --- Slow SP

2006-04-27 Thread Quentin Bennett
[snip] Next point is that MySQL will only make use of an index in a join or a where clause if ONLY that field is included in the index. If you pack 3 fields into an index and then try to join on ONLY ONE field, the index can't be used. So look at your joins and where clauses and make sure your

Re: HELP --- Slow SP

2006-04-27 Thread Daniel Kasak
Hardi OK wrote: Hi Forums, I have a frustrating problem on my Stored Procedure. It can only proccess about 100 records in 10 minutes. I have 2 million initial records that need to processed. Meaning that with this speed i will around 200 days to finish all of them. To make it worse, the data its

Re: help with SELECT BETWEEN

2006-04-25 Thread Shawn Green
--- Chris <[EMAIL PROTECTED]> wrote: > I want to create a SELECT statement using BETWEEN like: > SELECT * FROM mytable WHERE myfield BETWEEN value_1 AND value_2. The > field > I'm applying my BETWEEN clause is a varchar. > > Now, if value_1 and value_2 are numbers the select statement works a

Re: help with SELECT BETWEEN

2006-04-25 Thread Chris White
On Tuesday 25 April 2006 09:33 am, Chris wrote: > I want to create a SELECT statement using BETWEEN like: > SELECT * FROM mytable WHERE myfield BETWEEN value_1 AND value_2. The field > I'm applying my BETWEEN clause is a varchar. > If the appropriate format (enclosing or not enclosing with apostr

Re: Help Needed

2006-04-04 Thread Gabriel PREDA
If you do an INSERT and you generate an new number in an AUTO_INCREMENT field the new value generated can be retrieved using: *SELECT LAST_INSERT_ID();* You are not required to retrieve into the application and then use it back in another SQL statement... you can use user variables: *SELECT @lastG

RE: Help regarding a simple query

2006-03-13 Thread Jeff
>-Original Message- >From: VenuGopal Papasani [mailto:[EMAIL PROTECTED] >Sent: Monday, March 13, 2006 11:48 >To: Jeff >Subject: Re: Help regarding a simple query > > >Hi Jeff, > This is venu again.Last mail i did not include a constraint that is what irritatin

Re: Help regarding a simple query

2006-03-13 Thread Peter Brawley
Now i need to get all the records which consists of the string venu(case should not be considered either case should be).i.e i should get 1,2,3,4,5,8 records A simple way is ...  ...   WHERE LOCATE('venu', col_name ) > 0   ... or if the column is [VAR]BINARY, LOCATE('venu',CAST(col_name

RE: Help regarding a simple query

2006-03-13 Thread Jeff
> -Original Message- > From: VenuGopal Papasani [mailto:[EMAIL PROTECTED] > Sent: Monday, March 13, 2006 10:33 > To: mysql@lists.mysql.com > Subject: Help regarding a simple query > > > Hi, > I am searching for a query where i can have pattern > matching without considering the cases.

Re: Help creating index's for this query...

2006-03-10 Thread SGreen
Cory at SkyVantage <[EMAIL PROTECTED]> wrote on 03/10/2006 04:25:00 PM: > [EMAIL PROTECTED] wrote: > > Can you post the results of "SHOW CREATE TABLE pnr_segments", please > > pnr_segments | CREATE TABLE `pnr_segments` ( > `ID` bigint(20) NOT NULL auto_increment, > `ID_pnr` bigint(20) NOT NUL

Re: Help creating index's for this query...

2006-03-10 Thread gerald_clark
Cory at SkyVantage wrote: gerald_clark wrote: How many possible values may res_status have? What percentage for each value? It may not be possible to use an index on this field. The res_status field may have up to 10 different values from 0-9. and there will be a huge amounts of '0' and

Re: Help creating index's for this query...

2006-03-10 Thread Cory at SkyVantage
gerald_clark wrote: How many possible values may res_status have? What percentage for each value? It may not be possible to use an index on this field. The res_status field may have up to 10 different values from 0-9. and there will be a huge amounts of '0' and thousands of records with 1-9

Re: Help creating index's for this query...

2006-03-10 Thread Cory at SkyVantage
[EMAIL PROTECTED] wrote: Can you post the results of "SHOW CREATE TABLE pnr_segments", please pnr_segments | CREATE TABLE `pnr_segments` ( `ID` bigint(20) NOT NULL auto_increment, `ID_pnr` bigint(20) NOT NULL, `ID_pnr_fares` bigint(20) NOT NULL, `flight_number` int(10) unsigned NOT NULL, `

<    1   2   3   4   5   6   7   8   9   10   >