Well, if nothing can ever equal null, then why isn't MySQL query parser
smart enough to reduce my queries to something more sensible? If I'm
saying this:
SELECT *
FROM sometable
WHERE somecolumn = NULL OR somecolumn = 'abc';
Why isn't it able to reduce the query to something more lik
Thanks, that's exactly what I was after.
On Mon, 2009-12-28 at 14:53 -0800, Daevid Vincent wrote:
> Perhaps the examples here would help you:
> http://dev.mysql.com/doc/refman/5.0/en/date-calculations.html
>
> > -Original Message-
> > From: Noel Butler [mailto:noel.but...@ausics.net]
Well, if nothing can ever equal null, then why isn't MySQL query parser
smart enough to reduce my queries to something more sensible? If I'm
saying this:
SELECT *
FROM sometable
WHERE somecolumn = NULL OR somecolumn = 'abc';
Why isn't it able to reduce the query to something more like t
Miguel,
On Fri, Dec 25, 2009 at 4:56 PM, Miguel Angel Nieto
wrote:
>> Load balancing, or high availability?
>>
>> I do not think there is anything good and simple AND generic out of
>> the box. As previous posters have noted, you generally have to build
>> something on top of other tools.
>
> Hi
See:
http://gtowey.blogspot.com/2009/04/how-to-select-this-wednesday-or-other.html
just calculate the two dates, and use WHERE order_date BETWEEN (calculated
start date) AND (calculated end date)
This avoids using functions on the actual column when possible, since that will
prevent using index
On Mon, Dec 28, 2009 at 5:41 PM, Carsten Pedersen wrote:
> David Giragosian skrev:
>
>> On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorenso
>> wrote:
>>
>> Will anything ever be equal to NULL in a SELECT query?
>>>
>>
> ...
>
> What's so special about NULL?
>>>
>>
>>
>> http://dev.mysql.com/doc/r
Hi All,
trying to write some SQL that will give me records for the CURRENT WEEK.
Example, starting on a Sunday and going through Saturday.
This week it would be Dec 27 - Jan 2.
I am doing this so I can write a query that will show orders that are placed
during the current week.
Here is what I
I think you might be right. The good-to-poor performance I'm seeing is so
intermittent. And I see now that it's also with other queries, though not as
extremely obvious as the spatial queries. However, even if the Index can't fit
in memory (4GB of RAM, lots free), just reading it from disk shoul
Perhaps the examples here would help you:
http://dev.mysql.com/doc/refman/5.0/en/date-calculations.html
> -Original Message-
> From: Noel Butler [mailto:noel.but...@ausics.net]
> Sent: Saturday, December 26, 2009 6:47 PM
> To: mysql@lists.mysql.com
> Subject: anniversary selects
>
> Hi,
David Giragosian skrev:
On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorenso wrote:
Will anything ever be equal to NULL in a SELECT query?
...
What's so special about NULL?
http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html
Should answer some of your questions, Dante.
Oddly e
This will work:
select distinct X from a as a
where Y in(25)
and
not exists (select X from a as b where a.X = b.X and b.Y in(24))
- Original Message -
From: "Tim Molter"
To:
Sent: Sunday, December 27, 2009 4:04 PM
Subject: Is there a better way than this?
I'm new to MySQL and I'm
It sounds like your laptop might be paging mysql's memory to disk or something
like that. Your laptop may not be the most reliable source for benchmarks.
Regards,
Gavin Towey
-Original Message-
From: René Fournier [mailto:m...@renefournier.com]
Sent: Monday, December 28, 2009 2:16 AM
To
Hi,
Will anything ever be equal to NULL in a SELECT query?
No, never.
Null also means "unknown", if you design your tables well enough,
there should be no NULLs -stored- (different from a resultset,
where there can be nulls, for example in LEFT JOINs), because
it's no use to store what you d
I know the master/slave replication scheme for MySQL is pretty easy to
set up; I'm doing it lab now. My question is does anyone know if it
will successfully replicate foreign key constraints and large BLOB
date types.
Any feedback on this would be gratefully appreciated.
__
No, that won't work, remember that the WHERE clause is applied to each row
individually -- y is 25, then it also cannot possibly be 24 at the same time,
so AND condition has no meaning there. What you're asking for there is the set
of all x that have 25 as a y value, which is 1 and 2.
You need
On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorenso wrote:
>
> Will anything ever be equal to NULL in a SELECT query?
>
> SELECT *
> FROM sometable
> WHERE somecolumn = NULL;
>
> I have a real-life query like this:
>
> SELECT *
> FROM sometable
> WHERE somecolumn = NULL OR somecolumn = 'abc';
No, nothing will ever equal null. In strict relational theory, which I
don't know well enough to begin expounding on here, null does not even
equal another null. That's why SQL provides IS NULL and IS NOT NULL
as explicit cases.
- michael dykman
On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorens
Will anything ever be equal to NULL in a SELECT query?
SELECT *
FROM sometable
WHERE somecolumn = NULL;
I have a real-life query like this:
SELECT *
FROM sometable
WHERE somecolumn = NULL OR somecolumn = 'abc';
The 'sometable' contains about 40 million records and in this query, i
Gavin,
very nice,
- michael dykman
On Mon, Dec 28, 2009 at 2:16 PM, Gavin Towey wrote:
> No, that won't work, remember that the WHERE clause is applied to each row
> individually -- y is 25, then it also cannot possibly be 24 at the same time,
> so AND condition has no meaning there. What y
Ken D'Ambrosio wrote:
Hey, all. I've been using databases clear back to xBase days; that being
said, I've never had a solid foundation for relational databases. While I
can muddle by in SQL, I really don't have a good understanding of exactly
how keys are set up, the underpinnings of indexing,
Hey, all. I've been using databases clear back to xBase days; that being
said, I've never had a solid foundation for relational databases. While I
can muddle by in SQL, I really don't have a good understanding of exactly
how keys are set up, the underpinnings of indexing, and, oh, lots of
gro
From: Edward S.P. Leong [mailto:edward...@ita.org.mo]
Sent: Monday, December 28, 2009 9:25 AM
To: Jerry Schwartz
Cc: mysql@lists.mysql.com
Subject: Re: 32bit ( php + mysql server ) on 64bit Windows 2003 Server
performance
Jerry Schwartz wrote:
-Original Message-
From: Edward S.P. Le
I have two of Paul's books. They are both fantastic.
Mike O'Krongli
President and CTO
Acorg Inc
519 432-1185
- Original Message -
From: "Claudio Nanni"
To: "Ken D'Ambrosio"
Cc: "mysql"
Sent: Monday, December 28, 2009 10:33 AM
Subject: Re: Database fundamentals: wanna learn.
Hi K
Ken,
So, any suggestions -- books, courses, web sites, what-have-you -- that I
should be hitting up so I can have a better grasp of what's going on
behind the scenes?
http://dev.mysql.com/doc/refman/5.5/en/tutorial.html
Start at top left and work your way downwards & rightwards at
http://www
Hi Ken,
thanks for sharing!
If you want to start from scratch, I would go for a book like this:
http://www.amazon.com/SQL-Complete-Reference-James-Groff/dp/0071592555/ref=dp_ob_title_bk
I did not 'read' it thru, but this is the one I would buy.
If you want to embrace MySQL, in my opinion, the bes
Jerry Schwartz wrote:
>>-Original Message-
>>From: Edward S.P. Leong [mailto:edward...@ita.org.mo]
>>Sent: Thursday, December 17, 2009 7:25 AM
>>To: mysql@lists.mysql.com
>>Subject: 32bit ( php + mysql server ) on 64bit Windows 2003 Server
>>performance
>>
>>Dear all,
>>
>>Would you mind
Hey, all. I've been using databases clear back to xBase days; that being
said, I've never had a solid foundation for relational databases. While I
can muddle by in SQL, I really don't have a good understanding of exactly
how keys are set up, the underpinnings of indexing, and, oh, lots of
ground-
Even weirder, I came back to my laptop a couple hours later. And now the same
queries are taking 3-10 seconds instead of 0.01 seconds. What could be causing
this?
On 2009-12-28, at 1:19 PM, René Fournier wrote:
> Hmm, weird. I just re-imported the data (after drop/create table, etc.), and
> no
Thanks for the replies!
Chris, yeah, that's the first thing I tried. The problem though is
that SQL statement also returns Row #2 (x=1, y=25) since y=25 is
associated with both x=1 and x=2. I want it only to return row #3.
As John said, it may not be possible with a simple SQL statement.
My tabl
29 matches
Mail list logo