Re: does DISTINCT kill ORDER BY?

2006-09-06 Thread Chris
Markus Hoenicka wrote: Hi, is the following behaviour intended? Are my queries wrong? The output shows only the Extra field as the other fields are identical in all cases. EXPLAIN SELECT t_refdb.refdb_id FROM t_refdb WHERE t_refdb.refdb_id0 ORDER BY t_refdb.refdb_id; = Using where; Using

Re: does DISTINCT kill ORDER BY?

2006-09-06 Thread Markus Hoenicka
Chris [EMAIL PROTECTED] was heard to say: That is, if MySQL can't use an index to sort the result, DISTINCT queries won't be sorted at all. That doesn't make sense. How many rows fit that criteria? SELECT COUNT(DISTINCT t_refdb.refdb_id) FROM t_refdb WHERE refdb_type!='DUMMY' AND

MYSQL on GHS Integrity..

2006-09-06 Thread ravi.karatagi
Hi All, Anybody know how to install Mysql on GHS Integrity RTOS. Where I will get the mysql package for the same. Or can I use the same as for Linux. Regards, Ravi K The information contained in this electronic message and any attachments to this message are intended for

Re: does DISTINCT kill ORDER BY?

2006-09-06 Thread Markus Hoenicka
Just for the archives: looks like I bumped into bug #21456: http://bugs.mysql.com/bug.php?id=21456 This bug has been fixed in 4.1.22 and 5.0.25, so I'll just have to upgrade. Thanks anyway Markus Markus Hoenicka [EMAIL PROTECTED] was heard to say: Chris [EMAIL PROTECTED] was heard to say:

Ecommerce cart

2006-09-06 Thread wizard007
Hi, I am starting a site that enables people to purchase information using credits bought on the site. e.g. you buy 10 credits for £10 and they sit in your online account on the site for you to spend whenever you like. Does anyone know of a script or software already in existance that we can

Problems Updating Database

2006-09-06 Thread Nicholas Vettese
I have a registration script that inserts data into the database, and then emails you an activation code to activate your account. The problem is that when I click on the link in the email, the account does not get updated. The portion of the script that has a problem is this: $query = UPDATE

Re: Problems Updating Database

2006-09-06 Thread Jo�o C�ndido de Souza Neto
Which error do you get in activation page? Nicholas Vettese [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] I have a registration script that inserts data into the database, and then emails you an activation code to activate your account. The problem is that when I click on the

Re: Problems Updating Database

2006-09-06 Thread Jo�o C�ndido de Souza Neto
I can see something that can be the problem, in mysql 3 you don´t have trigger, then you cannot use trigger_error function, try to use mysql_error instead. Nicholas Vettese [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] I have a registration script that inserts data into the

SQL order by BUG?

2006-09-06 Thread Jørn Dahl-Stamnes
I get the following query: select rt.team_id,count(p.race_id) as cnt,sum(p.points) as sum_score,sum(p.points) / count(p.race_id) as avg_score from some tables, joins and where-criterias group by rt.team_id order by avg_score desc; which gives: +-+--+---+---+ |

Re: Problems Updating Database

2006-09-06 Thread Miles Thompson
At 08:22 AM 9/6/2006, Nicholas Vettese wrote: I have a registration script that inserts data into the database, and then emails you an activation code to activate your account. The problem is that when I click on the link in the email, the account does not get updated. The portion of the

Re: SQL order by BUG?

2006-09-06 Thread Jo�o C�ndido de Souza Neto
Try to use 'avg_score desc,sum_score desc' Jørn Dahl-Stamnes [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] I get the following query: select rt.team_id,count(p.race_id) as cnt,sum(p.points) as sum_score,sum(p.points) / count(p.race_id) as avg_score from some tables, joins and

Re: SQL order by BUG?

2006-09-06 Thread Philippe Poelvoorde
2006/9/6, Jørn Dahl-Stamnes [EMAIL PROTECTED]: I get the following query: select rt.team_id,count(p.race_id) as cnt,sum(p.points) as sum_score,sum(p.points) / count(p.race_id) as avg_score from some tables, joins and where-criterias group by rt.team_id order by avg_score desc; which gives:

Re: SQL order by BUG?

2006-09-06 Thread Jørn Dahl-Stamnes
On Wednesday 06 September 2006 15:20, you wrote: the direction (desc/asc) order qualifier is per-sortfield and defaults to asc, so to get what you're after you'd want: order by avg_score desc, sum_score desc or order by avg_score desc, sum_score if you're after 'asc' on sum_score.

Re: IN ANY subqueries

2006-09-06 Thread Philippe Poelvoorde
2006/9/5, Ben Lachman [EMAIL PROTECTED]: So possibly a better solution would be to create a temporary table and then do a subquery on that table? yes. Or do a : SELECT id FROM t1 WHERE name LIKE '%s1%' OR name LIKE %'s2%' OR name LIKE '%s3%' but depending on your data, a table may be the way

Re: SQL subqueries and JOIN conditions

2006-09-06 Thread Philippe Poelvoorde
2006/9/4, [EMAIL PROTECTED] [EMAIL PROTECTED]: Hello all, I need to perform an SQL statement over 5 different tables, with complex request. To do so, i'm using subqueries. SELECT ... FROM (SELECT .WHERE) as T1 LEFT JOIN (SELECT .WHERE) as T2 WHERE . The problem is that

SELECT counting chars with LEFT()

2006-09-06 Thread spacemarc
Hi, I want to get all records from Tab1 and the first 20 words for the fieldA SELECT *, LEFT(fieldA, 20) AS fieldA FROM Tab1 But this query does not work: why? thanks! -- http://www.spacemarc.it -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

RE: Problems Updating Database

2006-09-06 Thread Nicholas Vettese
$x and $y work perfectly, and I believe the problem is the trigger function. Thanks to everyone who helped, and as soon as I get a chance to update and fix, I will try it. Thanks, Nick -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 06,

Re: Adding and Removing tables from MERGE tables dynamically

2006-09-06 Thread Brent Baisley
I've got a similar setup, total records across about 8 tables hoovers around 200 million. To change a merge table just issue an alter table with a new union. ALTER TABLE mergetable UNION=(table1, table2, table3,...); - Original Message - From: Jacob, Raymond A Jr [EMAIL PROTECTED]

Re: SELECT counting chars with LEFT()

2006-09-06 Thread Miles Thompson
At 10:55 AM 9/6/2006, spacemarc wrote: Hi, I want to get all records from Tab1 and the first 20 words for the fieldA SELECT *, LEFT(fieldA, 20) AS fieldA FROM Tab1 But this query does not work: why? thanks! -- http://www.spacemarc.it First of all - please reply to the list .. I

Re: SELECT counting chars with LEFT()

2006-09-06 Thread spacemarc
2006/9/6, Miles Thompson [EMAIL PROTECTED]: First of all - please reply to the list .. I thought you wanted all fields, that's the way your SELECT statement is constructed. If just the first 20 char from fieldA, then ... SELECT LEFT(fieldA, 20) AS fieldA FROM Tab1 should do what you

RE: SELECT counting chars with LEFT()

2006-09-06 Thread Bill Tantzen
You know, this works just fine for me -- when you say it is NOT working, what do you mean exactly? Are you getting an error? Or results that you don't expect? Bill Tantzen University of Minnesota Libraries [EMAIL PROTECTED] 612-626-9949 (office) 612-250-6125 (cell)

Re: SELECT counting chars with LEFT()

2006-09-06 Thread ESV Media GmbH
Hello MySQL-User, i need your help with the following query. I want to get the next birthdays of my friends, but not only the one of this year. So when im in december ( or november ) i want to see the birthdays of next year too With my query i only see the birthdays of this year : SELECT

Getting next Birthdays

2006-09-06 Thread ESV Media GmbH
Hello MySQL-User, i need your help with the following query. I want to get the next birthdays of my friends, but not only the one of this year. So when im in december ( or november ) i want to see the birthdays of next year too With my query i only see the birthdays of this year : SELECT

Re: SELECT counting chars with LEFT()

2006-09-06 Thread spacemarc
2006/9/6, Bill Tantzen [EMAIL PROTECTED]: You are actually selecting fieldA twice -- the first time (with '*') will return the entire column. The second time with only the first 20 chars. If you only want to see the first 20 chars, you will have to explicitly name every column in your select

K12 Academics

2006-09-06 Thread Chris Glavin
Hello, My name is Chris Glavin. I emailed you because you are an educator. I run a website which is all about Education Disabilities. It is geared towards parents, students, teachers, district officials professionals. I ask that you take a few minutes out of your busy schedule to visit my

RE: problem with InnoDB

2006-09-06 Thread prasad.ramisetti
Hi Dan, Thanks for yur response. Does it makes sense to create an index on a primary key ..as that is my smallest field ? Regards Prasad -Original Message- From: Dan Nelson [mailto:[EMAIL PROTECTED] Sent: Monday, September 04, 2006 9:53 AM To: Prasad Ramisetti (WT01 - Broadband

Re: problem with InnoDB

2006-09-06 Thread Chris
[EMAIL PROTECTED] wrote: Hi Dan, Thanks for yur response. Does it makes sense to create an index on a primary key ..as that is my smallest field ? A primary key already has an index. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: problem with InnoDB

2006-09-06 Thread Douglas Sims
Hi Prasad A primary key automatically creates an index and not-null and unique constraints, too. So you don't need to explicitly create an index on a primary key column. If your queries are going to have WHERE clauses (as they most likely are) I'm not sure how the small-index suggestion

Re: problem with InnoDB

2006-09-06 Thread Dan Nelson
In the last episode (Sep 07), [EMAIL PROTECTED] said: Hi Dan, Thanks for yur response. Does it makes sense to create an index on a primary key ..as that is my smallest field ? It might, because in an InnoDB table, your primary index also holds your row data. So it's actually your largest