On 18 April 2011 20:19, Joerg Bruehe wrote:
> Hallo everybody!
>
>
> Ants Pants wrote:
> > Hello All,
> >
> > Tables:
> > # relevant fields
> > invitations: donation_pledge, paid (boolean), currency_id
> > currencies: code
> >
> >
> > I am trying to subtract the paid amounts from the amounts pled
Hallo everybody!
Ants Pants wrote:
> Hello All,
>
> Tables:
> # relevant fields
> invitations: donation_pledge, paid (boolean), currency_id
> currencies: code
>
>
> I am trying to subtract the paid amounts from the amounts pledged using a
> subquery in the FROM clause but am having problems an
On Wed, 2006-08-23 at 22:23 +0200, spacemarc wrote:
> Hi,
> I have a query like this:
>
> SELECT table1.*,(
> SELECT COUNT( field2 )
> FROM table2
> WHERE id=10
> ) AS total
> FROM table1
> GROUP BY id
> LIMIT 1
>
> but the subqueries do not work with mysql < 4.1. How can I convert it
> (or make
See http://dev.mysql.com/doc/refman/5.0/en/rewriting-subqueries.html
for some tips
Dan
On 8/23/06, spacemarc <[EMAIL PROTECTED]> wrote:
Hi,
I have a query like this:
SELECT table1.*,(
SELECT COUNT( field2 )
FROM table2
WHERE id=10
) AS total
FROM table1
GROUP BY id
LIMIT 1
but the subqueries
Greg Whalin wrote:
We have noticed this as well and it is really pretty shoddy. It seems
that when using IN( SELECT ), they treat it as ANY() which does a
full table scan.
Only way we have found to get fast performance out of subqueries is to
use the derived table format and join with the
We have noticed this as well and it is really pretty shoddy. It seems
that when using IN( SELECT ), they treat it as ANY() which does a
full table scan.
Only way we have found to get fast performance out of subqueries is to
use the derived table format and join with the derived table. But
You must be having a problem with your email client as this is about the
ninth time I have seen this same request today. Please check your client
for problems. I know because I have responded once already.
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine
<[EMAIL PROTECTED]> w
sday, December 08, 2004 9:28 PM
> To: Lakshmi NarasimhaRao (WT01 - TELECOM SOLUTIONS)
> Cc: mysql@lists.mysql.com
> Subject: Re: SubQueries
>
> Since 4.0.22 does NOT have subqueries, you will have to use a JOIN
> http://dev.mysql.com/doc/mysql/en/JOIN.html
> http://d
Since 4.0.22 does NOT have subqueries, you will have to use a JOIN
http://dev.mysql.com/doc/mysql/en/JOIN.html
http://dev.mysql.com/doc/mysql/en/Rewriting_subqueries.html
... as in this example
SELECT PAGE_SERVICE.TIMEOUT
, PAGE_SERVICE.PAGE_SERVICE_COMMENT
, PAGE_SERVIC
I believe this will work as you want:
select h1.*
FROM hist h1
LEFT JOIN hist h2
on h1.tel = h2.tel
and h2.date_h < '20041027'
where h1.date_h = '20041027'
and h2.tel is null;
This query should return all of the rows from the hist table where the tel
value appears for the date yo
Wouter Coppieters <[EMAIL PROTECTED]> wrote:
>
> We installed version 4.1.0-alpha-max-nt and try to run a query with a
> subquery and get the message
>
> [DB_BAS_LOCAL] ERROR 1235: This version of MySQL doesn't yet support 'LIMIT
> & IN/ALL/ANY/SOME subquery'
>
>
> Are subqueries supporeted i
Sebastian Tobias Mendel genannt Mendelsohn <[EMAIL PROTECTED]> wrote:
>>>SELECT product_id, name, description, sales.sale_id
>>>FROM products LEFT JOIN sales ON products.product_id = sales.product_id
>>>WHERE sales.customer_id = 10 AND sales.sale_id IS NULL
>>
>>
>> This query should return no ro
SELECT product_id, name, description, sales.sale_id
FROM products LEFT JOIN sales ON products.product_id = sales.product_id
WHERE sales.customer_id = 10 AND sales.sale_id IS NULL
This query should return no rows, because if you retrieve rows where sales.sale_id is NULL, customer_id for these rows
"Andy Hall" <[EMAIL PROTECTED]> wrote:
>
> I have just started using MySQL from MSSQL 7. I need to port the following
> into MySQL from an existing (working) query on MSSQL Server:
>
> SELECT product_id, name, description
> FROM products
> WHERE product_id NOT IN (SELECT product_id FROM sales WHE
> >
> You need to get the conditions for the LEFT JOIN out of the WHERE clause:
>
> SELECT product_id, name, description, sales.sale_id
> FROM products
> LEFT JOIN sales ON
> products.product_id = sales.product_id WHERE
> sales.sale_id IS NULL AND
> sales.customer_id = 10
>
I lied
Thanks for the query suggestions, but unfortunately none of them seem to do
the trick.
Not possible to upgrade to 4.x at the moment, so I am going to have to do it
in 2 queries; one to get the list of ID's, then create a list in PHP and
drop it into the second query.
Thanks for the help!
Andy Ha
* Andy Hall
> I have just started using MySQL from MSSQL 7. I need to port the following
> into MySQL from an existing (working) query on MSSQL Server:
>
> SELECT product_id, name, description
> FROM products
> WHERE product_id NOT IN (SELECT product_id FROM sales WHERE customer_id =
> 10)
>
> i.e.
> sub-queries, but also seen examples of it done. Is it only supported in a
> later version? We are running v. 3.23.3.
As far as I know, subqueries are only supported in MySQL v4(.1?)+
Chris
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http:/
Andy:
Sub queries are supported as of version 4.1 (see link #1). As for your
query, double-check the syntax in the select piece. Specifically take out
the 'sales.sale_id' and anything else from the 'sales' table. Then try
again.
Regards,
Adam
Link #1 - http://www.mysql.com/doc/en/ANSI_diff_Subqu
Andy Hall wrote:
Hi,
I have just started using MySQL from MSSQL 7. I need to port the following
into MySQL from an existing (working) query on MSSQL Server:
SELECT product_id, name, description
FROM products
WHERE product_id NOT IN (SELECT product_id FROM sales WHERE customer_id =
10)
i.e. get al
RDBMSs. Give us a
>break.
>
>>-Original Message-
>>From: Andrew Houghton [mailto:[EMAIL PROTECTED]]
>>Sent: Thursday, June 27, 2002 9:10 AM
>>To: Dave Morse
>>Cc: 'Paul DuBois'; 'Arul'; [EMAIL PROTECTED]; 'MySQL'
>>Subjec
[EMAIL PROTECTED]]
> Sent: Thursday, June 27, 2002 9:10 AM
> To: Dave Morse
> Cc: 'Paul DuBois'; 'Arul'; [EMAIL PROTECTED]; 'MySQL'
> Subject: Re: SubQueries and Temp Tables
>
>
> It makes sense to many, or most, I'd say. Oracle produce
ource" server in C and a
> client in Java makes sense, I guess to some.
>
> > -Original Message-
> > From: Paul DuBois [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 26, 2002 5:37 PM
> > To: Dave Morse; 'Arul'; [EMAIL PROTECTED]
> > Cc:
ednesday, June 26, 2002 5:37 PM
>>To: Dave Morse; 'Arul'; [EMAIL PROTECTED]
>>Cc: 'MySQL'
>>Subject: RE: SubQueries and Temp Tables
>>
>>
>>At 7:16 -0700 6/26/02, Dave Morse wrote:
>>
>>>MySQL is barely an SQL database - it doesn'
a, do you require a Web server to be
written in Java before you'll connect to it?
>
>> -Original Message-
>> From: Paul DuBois [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, June 26, 2002 5:37 PM
>> To: Dave Morse; 'Arul'; [EMAIL PROTECTED]
; [EMAIL PROTECTED]
> Cc: 'MySQL'
> Subject: RE: SubQueries and Temp Tables
>
>
> At 7:16 -0700 6/26/02, Dave Morse wrote:
> >MySQL is barely an SQL database - it doesn't support much
> basic SQL 89
> >functionality. Can any one throw some light on why profes
At 7:16 -0700 6/26/02, Dave Morse wrote:
>MySQL is barely an SQL database - it doesn't support much basic SQL 89
>functionality. Can any one throw some light on why professional SQL
>database developers want to use it for anything but simple file
>management? AND It is written in C as well so why
gt; - Original Message -
> From: "Ralf Narozny" <[EMAIL PROTECTED]>
> To: "Arul" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>; "MySQL" <[EMAIL PROTECTED]>
> Sent: Wednesday, June 26, 2002 3:00 PM
> Subject: Re: SubQuerie
MySQL is barely an SQL database - it doesn't support much basic SQL 89
functionality. Can any one throw some light on why professional SQL
database developers want to use it for anything but simple file
management? AND It is written in C as well so why do Java developers
use it?
Regards,
Dave
;MySQL" <[EMAIL PROTECTED]>
Sent: Wednesday, June 26, 2002 3:00 PM
Subject: Re: SubQueries and Temp Tables
> Hiho hiho!
>
> Which joins could that be? I think most if not all subqueries should be
> replacable with joins.
>
> Greetings
> Ralf
>
> Arul wrote
Hiho hiho!
Which joins could that be? I think most if not all subqueries should be
replacable with joins.
Greetings
Ralf
Arul wrote:
>Hi All
>
> I am currently porting our application from Oracle to MySQL.
>We have some subqueries in oracle which cannot be ported into MySQL.We even
>tried so
Arul,
Wednesday, May 29, 2002, 1:05:02 PM, you wrote:
A> i am running MySql 3.23.49 Max on Win 2K
A> Does this version of MySQL supports subqueries.
Nope. How to re-write queries read in our manual:
http://www.mysql.com/doc/A/N/ANSI_diff_Sub-selects.html
A> Also does this support transac
It can't, try using JOIN.
Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com
- Original Message -
From: "Leo Przybylski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 03, 2002 1:35 PM
Subject: Subqueries
> Hello all,
>
> Does anyone kno
On Wednesday 03 April 2002 12:35 pm, Leo Przybylski wrote:
> Hello all,
>
> Does anyone know if MySQL can do subqueries?
Not the current version, no.
>
> I am trying to provide a SELECT subquery to an IN clause and I am getting
> errors. Is this possible?
Read the manual and follow the example
No
that's a 4.1 TODO.
Bryan Capitano wrote:
>
> Do any of the newer versions of MySQL support sub-queries yet?
>
> -
> Before posting, please check:
>http://www.mysql.com/manual.php (the manual)
>http://lists.mysql
Hi.
For many sub-queries, there exists a one-query work-around.
Most of the rest, you can work-around with some commands.
And then, there are a few around which one has to work in application.
There is a section in the manual about how to handle the lack of
sub-queries, which explains the most
36 matches
Mail list logo