Re: Exists BUG in "IN" ?

2005-09-26 Thread Michael Stassen
Dyego Souza Dantas Leal wrote: Hello Guys, I'm using the 5.0.12 version of MySQL PRO on AMD64 3000+ with 1 GB of ram and using the InnoDB Tables.. Here is the Select: mysql> select f1.fc_package from svcs_filecontrol f1 where f1.fc_id in ( -> *select max(f2.fc_id) from svcs_filecontr

Re: EXISTS subquery optimization

2005-09-17 Thread Pooly
Hi, > Now as expected it's an dependent subquery and makes use of the index on > document_id. BUT: If we change the "SELECT id" in the subquery to > "SELECT document_id" or "SELECT 1", we get: > > *** 1. row *** > [...] > **

Re: EXISTS

2005-06-01 Thread Anoop kumar V
You can use joins instead of subqueries if you cannot upgrade to 4.1.x of mysql. Actually in my opinion joins are more efficient than subqueries. Subqueries (more often than not) tend to become bottlenecks in the long run.. http://dev.mysql.com has a some reference material about converting su

Re: EXISTS

2005-06-01 Thread Felix Geerinckx
On 31/05/2005, Lucio Crusca wrote: > I use mysql 4.0.24 as found in debian gnu/linux sarge. > mysql> select * from SAMPLES S1 where exists (select * from SAMPLES > S2 where S1.ID = S2.ID); > > ERROR 1064: You have an error in your SQL syntax. Check the manual > that corresponds to your MySQL ser

RE: EXISTS/NOT EXISTS

2004-06-18 Thread Anton Ivanov
] Sent: Friday, June 18, 2004 2:38 PM To: Anton Ivanov Cc: [EMAIL PROTECTED] Subject: Re: EXISTS/NOT EXISTS Subqeries require mysql 4.1. The manual offers some suggestions on rewriting subqueries as JOINs <http://dev.mysql.com/doc/mysql/en/Rewriting_subqueries.html>. In your case, yo

Re: EXISTS/NOT EXISTS

2004-06-18 Thread Michael Stassen
Subqeries require mysql 4.1. The manual offers some suggestions on rewriting subqueries as JOINs . In your case, you want something like: SELECT product FROM products p LEFT JOIN products_by_product_areas a ON p.product = a.product

Re: EXISTS/NOT EXISTS

2004-06-18 Thread Andrew Pattison
You are using a subquery. Subqueries are only supported in version 4.1 and later. You will eithe rneed to rewrite your query so that it doesn't use a subquery, or upgrade. Cheers Andrew. - Original Message - From: "Anton Ivanov" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday,

Re: Exists

2004-05-14 Thread A Z
MySQL 4.0.14 regards --- Rhino <[EMAIL PROTECTED]> wrote: > What version of MySQL are you running? The answer to > your question depends > on the version. > > Rhino > > - Original Message - > From: "A Z" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, May 14, 2004 9:00

Re: Exists

2004-05-14 Thread Josh Trutwin
On Fri, 14 May 2004 14:00:46 +0100 (BST) A Z <[EMAIL PROTECTED]> wrote: > Hi, > > How can I write this query? > > Insert into table1 (field1) select (a.field1) from > table2 a where a.field1 not exists (select c.field1 > from table1 c) http://dev.mysql.com/doc/mysql/en/Rewriting_subqueries.html

Re: Exists

2004-05-14 Thread Rhino
What version of MySQL are you running? The answer to your question depends on the version. Rhino - Original Message - From: "A Z" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, May 14, 2004 9:00 AM Subject: Exists > Hi, > > How can I write this query? > > Insert into table1

Re: EXISTS : in MySQL 4.0.* ?

2004-04-28 Thread Egor Egorov
Andy Jefferson <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using MySQL 4.0.15 and have been trying to use EXISTS/NOT EXISTS ... > with no success - getting "You have an error in your SQL syntax". > > I've got 2 tables A and B and am trying something like this > > SELECT THIS.A_ID FROM A THIS > WHE

Re: EXISTS : in MySQL 4.0.* ?

2004-04-28 Thread Jigal van Hemert
> Does EXISTS exist in 4.0.15 ? or is it introduced in 4.1.*. If it does > exist, what is incorrect in the syntax above ? (it matches the MySQL manual > example from what I can see). Subqueries (http://dev.mysql.com/doc/mysql/en/Subqueries.html) were only introduced in version 4.1, so I don't thin

Re: EXISTS Clause

2003-11-03 Thread Victoria Reznichenko
Heinrich Stoellinger <[EMAIL PROTECTED]> wrote: > Does MySQL support the "EXISTS" / "NOT EXISTS" clause in table query > statements? It's supported since version 4.1 > What I want to do is to find tuples which do NOT have > corresponding tuples in another table. For example - tell me who in my

Re: Exists anything like Oracle TO_DATE('31/12/2003','dd/mm/yyyy') ?

2003-06-20 Thread richardb
use DATE_FORMAT(date, format) e.g: DATE_FORMAT("1999-12-01", "%M %e, %Y") -> "December 1, 1999" *taken from Paul Dubois MySQL book BRgds, -- Richard Bornay Test Data Managment ST Assembly Test Services 6824-1367 "Marcos Pomar" <[EMAIL PROTECTED]>20/06/2003 05:36 PM To: [EMAIL PR

RE: Exists and Not exists

2001-03-20 Thread Cal Evans
Sorry, MySQL does not yet support sub-selects. Cal http://www.calevans.com -Original Message- From: Budiono Tjiayono [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 6:17 AM To: [EMAIL PROTECTED] Subject: Exists and Not exists Hi there, I am a mysql newbie. Is there anybody t