Re: Efficiently modeling sets and subsets in lattice-like structure

2007-05-30 Thread mizioumt


Hi Kelly,

I'm pretty sure there's no universal efficient solution to this 
problem, this must be the well known answer
you are looking for. The pure mathematics of 'very hard' could be very 
hard to express, though.
So before you choose a solution you need to find out more about the 
actual graphs you're working
On the other hand there are plenty of possible approaches to the graph 
storage problem.
They do seem to concentrate on trees (XML is one of the better ones). 
So you could approach the graph representation
problem as a tree of trees, or as a set of separately stored trees 
joined logically over common nodes.

I doubt you could find many solutions in that direction.
Then since a graph is a binary relation over a set of nodes you could 
represent it as a 2 field relational table in an obvious way.

SQl isn't very good with trees, though.
In any case on model 'a Bunch Of Regular Guys' could code themselves (I 
did it once!) is a representation
of the binary relation as a bit matrix. You'll need N*N bits where N is 
the number of nodes so it's not going to scale well
but if you do happen to have fewer than 90K nodes (1G matrix) you could 
use it directly. If you have more nodes but
the number of ones in the matrix is not too high you could compress the 
matrix somewhat at the expense of extraction/update performance.
If you have many nodes with lots of connections you're out of luck 
anyway.
For persistent storage in this case you could use a relational table in 
few obvious ways, or just a file.

Example:

7 11 15 X Y 15 20 25 Z 14 30
1 2 3 4 5 6 7 8 9 10 11 12

maintaining this array is a separate issue (or non issue), here a two 
field table in an RDBMS is definitely appropriate.


1 2 3 4 5 6 7 8 9 10 11 12
1 all zeroes
2 all zeroes
3 all zeroes
4 1 1 1 0 1 0 ... # 4 is X which is 7 11 15 Y
5 0 0 0 0 0 0 1 1 1 1 0 0 # 5 is Y which is 15 20 25 Z
6 and so on
7
8
9
10
11
12

now if your sets are ordered and {7,11} is not the same as {11,7} this 
isn't going to work at all...


Thanks,
Michael
-Original Message-
From: Kelly Jones <[EMAIL PROTECTED]>Bunch Of Regular Guys
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; 
[EMAIL PROTECTED]; mysql@lists.mysql.com

Sent: Wed, 30 May 2007 2:53 pm
Subject: Efficiently modeling sets and subsets in lattice-like structure


Apologies for the mass cross-posting: I haven't been able to find a 
single 

answer or reference for the problem below (googling didn't help), and 
was hoping someone could point me to something helpful. I'm convinced 
there's a well-known answer here that I just can't find :( 
 
We're modeling a collection of (finite mathematical) sets, where sets 
may contain each other as subsets. 
 
For example, set X may be defined as "{7,11,15} + Y" meaning X 
contains 7, 11, 15, and all the members of set Y. Set Y could then be 
"{15,20,25} + Z", and Z might be "{7,14,30}" with no subsets. 
 
Of course, no set includes itself, directly or indirectly. 
 
However, one set may include many other subsets (eg, X may include 
both Y and Z), and one set may be included in many others (eg, X may 
be included in sets V and W). 
 
If the sets were nodes in a directed graph, the graph would be 
acyclic, but not a tree. I believe this is called a "lattice"(?). 
 
How can we efficiently model this "lattice" of sets either using SQL 
or some other technique? Specifically: 
 
% Add or remove members/subsets from a set and have the changes 
"bubble up" the lattice efficiently. 
 
% Find all members of a set X, efficiently traversing subsets. In 
other words, find all nodes/leaves of the subtree rooted at X 
 
% For a given set X, find all sets that contain X as a subset, 
directly or indirectly (eg, if Y contains X, and Z contains Y, return 
both Y and Z). In other words, find all the nodes that have X as a 
sub-node. 
 
The most promising lead I'd found was: 
 
http://dev.mysql.com/tech-resources/articles/hierarchical-data.html 
 
(which is why I'm cc'ing the MySQL list), but this only works with 
trees, and I couldn't figure out how to modify it for lattices. 
 
-- We're just a Bunch Of Regular Guys, a collective group that's trying 
to understand and assimilate technology. We feel that resistance to 
new ideas and technology is unwise and ultimately futile. 
 
-- MySQL General Mailing List 
For list archives: http://lists.mysql.com/mysql 
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]

 



Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.

=0

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: spool data/log into a file.

2007-04-26 Thread mizioumt
most likely you just need to redirect STDERR to tee as well so it's not 
a mysql problem:


mysql -u -p -f << eof 2>&1 | tee ttt.txt
...

assuming it's Bourne or ksh, don't remember what's csh for 2>&1

Regards,
Michael

-Original Message-
From: [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Thu, 26 Apr 2007 8:15 AM
Subject: spool data/log into a file.

Hi All,
I have written a script to connect to mysql and all the command results 
is

spooled into a file.
But when an error occurs in mysql, it stops at that point and does not
proceed to the next command, also these error command is not written to 
the

output file.

Can you please tell me what i need to do, for the script to continue 
even if

there is an error and that these errors should be spooled into a file.

I have used -f(force) option while connecting to mysql db, it continues 
even
if there is any error in the script, but it does not write error 
command
into the output file. Can you please help how can i spool all the 
output

into a file.
Below is the simple script i am using, ttt.txt is the file which will
contain the all the output of the script.

mysql -u -p -f << eof | tee ttt.txt

use dev1;
select count(*) from rep_abc;
select count(*) from rep_fact;

exit
eof

Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Safe DB Distribution

2007-01-30 Thread mizioumt

I think in the software world pretty much anything can be done,
not 100% to the specs but using the 'for all practical purposes'
criteria.
it's a matter of the cost but the PHP + mysql combination
certainly can't protect the datamodel because most of it
can be hacked from the data files themselves. So first thing
the OP needs is a custom mysql code to make it difficult
(not impossible). One thing that comes to mind
is to disable all forms of caching to avoid getting much from the 
memory dumps.
If he's willing to do this than switching from PHP to a binary 
executable

will be a breeze, or the PHP script will use callouts to proprietary
interface of the customized mysql.
I think it would be safe to claim that all data in the world that is 
worth this kind

of investment is already available either free or for a modest fee,
think Linux or mysql source code or any good book you can by for a few 
dollars.
Bigger products often have a funny and not at all intentional builtin 
mechanism
against pirating where it's very hard to install and use the software 
unless

you also buy a support contract.

Thanks,
Michael

-Original Message-
From: [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Tue, 30 Jan 2007 1:52 PM
Subject: Re: Safe DB Distribution

[EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]
R04.sysops.aol.com:


Something like distributing files with encrypted data in most columns
can be done


I think the OP is more concerned with protecting his datamodel, and 
this

cannot be done in my opinion.

--
felix

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]

Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Safe DB Distribution

2007-01-30 Thread mizioumt

> You will not be able to search on encrypted fields.


Right. There are ways around it but obviously all sorts of subtle 
application work will go with the data, depending

on what exactly is that you are trying to protect.
Overall my opinion is that if you distribute it in a country where
software piracy is a norm, someone will hack it anyway,
in all other countries it's probably less expensive overall
just distribute it and hope that most customers will comply with the 
law.
If you have competition you'd prefer people steal your stuff and not 
theirs.


Thanks,
Michael

-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; mysql@lists.mysql.com
Sent: Tue, 30 Jan 2007 1:44 PM
Subject: Re: Safe DB Distribution

[EMAIL PROTECTED] wrote:

Something like distributing files with encrypted data in most columns
can be done, with the encryption key being a combination
of some hardware-related stuff such as MAC address that the user will
provide to you, and the key you generate and provide to the user.
Of course it creates a problem when the target computer crashes.
Everything else is probably either hackable or would be based
on the assumption that you'll be in the business forever
but anyway there must be specialists out there in some security 

related

groups that know how to make it hard to hack.
> On the surface of it if you provide this sort of protection you'll 

be > able to distribute

it as open source since you are protecting data and not the code but
I'm sure bigger lycensing minds will easily prove me wrong and 

explain
that there is such a thing as a GPL for data and copyrighting data is 

bad,
which would mean that copyrighting anything is bad, or that 

copyrighting
data is OK but the essence of your application is data so if you 

charge

for it you can't distribute mysql with it under GPL etc.
Actually it would be interesting to hear the opinion of mysql legal > 

department on this.

> Thanks,
Michael

-- > felix
> -- > MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 

http://lists.mysql.com/[EMAIL PROTECTED]


 

Check Out the new free AIM(R) Mail -- 2 GB of storage and > 

industry-leading spam and email virus protection.

> You will not be able to search on encrypted fields.


-- Gerald L. Clark
Supplier Systems Corporation

Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Safe DB Distribution

2007-01-30 Thread mizioumt

Something like distributing files with encrypted data in most columns
can be done, with the encryption key being a combination
of some hardware-related stuff such as MAC address that the user will
provide to you, and the key you generate and provide to the user.
Of course it creates a problem when the target computer crashes.
Everything else is probably either hackable or would be based
on the assumption that you'll be in the business forever
but anyway there must be specialists out there in some security related
groups that know how to make it hard to hack.

On the surface of it if you provide this sort of protection you'll be 
able to distribute

it as open source since you are protecting data and not the code but
I'm sure bigger lycensing minds will easily prove me wrong and explain
that there is such a thing as a GPL for data and copyrighting data is 
bad,

which would mean that copyrighting anything is bad, or that copyrighting
data is OK but the essence of your application is data so if you charge
for it you can't distribute mysql with it under GPL etc.
Actually it would be interesting to hear the opinion of mysql legal 
department on this.


Thanks,
Michael

-Original Message-
From: [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Tue, 30 Jan 2007 4:08 AM
Subject: Re: Safe DB Distribution

[EMAIL PROTECTED] ("Suhas Pharkute") wrote in
news:[EMAIL PROTECTED]:


I want to distribute the MySQL DB to different user with an PHP web
app.


Make sure you have read and understood the MySQL licensing policy, if 
your

app is not open source (as it seems to be).


My biggest problem is MySQL data files. Is there anyway by which
I can configure the MySQL so that only PHP script can read it and if
you happen to copy the Data files and try to use it, that will be
useless.


No.

--
felix

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]

Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: General MySQL Question: Ed Reed (CA, United States of America) Medium

2007-01-30 Thread mizioumt

Hi Ed,

the subject line of your message indicates you live in California
in which case Santa Clara won't add much to the experience,
but most other people could enjoy visiting California a lot
especially if they don't mind dedicating entire day driving to Sierra 
Nevada.

One off the beaten path route is to cross the Sierra on hwy 108,
pass by Lake Mono
and return on hwy 120 through Yosemite.
Even around Santa Clara there are some possibilities for a good drive,
try to get to the observatory in San Jose (hwy 103 or 104),
or just cross the Coastal range around Santa Clara and take hwy 1 North
to San Francisco.
Other than the natural beauty the place is pretty sterile
but from my experience it applies to most of the country anyway.
The clubs in downtown San Jose are decent especially if you manage
to find one with live music.
I'd consider visiting one of mysql conferences if they had one
in a nice place like Panama City (in Panama, not in Florida).

Thanks,
Michael

-Original Message-
From: [EMAIL PROTECTED]
To: mysql@lists.mysql.com; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Mon, 29 Jan 2007 4:57 PM
Subject: Re: General MySQL Question: Ed Reed (CA, United States of 
America) Medium


I just didn't enjoy the location. When it was in Orlando a few years 
ago, it was
great. There were plenty of things to do and see; different places to 
eat every
night. I had a really good time. Then the following year I went to 
Santa Clara
and there was nothing to do. I went to the movies one night. Had dinner 
at
Sizzler three times. I drove 45 minutes to find a place I could buy a 
shirt. The
rest of the time I stayed in the hotel and watched crappy tv. If you 
folks want
me to be away from my family and friends for five days you've gotta 
give me a
reason to wanna go besides the great technical information. I didn't go 
to last
years, I'm not going to this years and I probably won't go to any 
future ones
held in Santa Clara. When I came home from the last one, my kids asked 
what I
got them from my trip and I had nothing for them. It was just a boring 
place to
go and I don't wanna go back. I'd just like to see it held someplace 
new every

year.

Thanks for replying to my comment



Lenz Grimmer <[EMAIL PROTECTED]> 1/25/07 2:21 AM >>>

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Ed,

thank you for your message!

On Thu, 18 Jan 2007, Ed Reed has filled out the MySQL Contact Form with 
a

General MySQL Question:

Can someone tell me you folks are going to hold all future User 

Conferences
in Santa Clara? I would like to go this year but I didn't enjoy 

myself at the
last one I went to in Santa Clara in '05 and I don't wanna go back. 

If you
folks plan to hold all future conferences there I'd like to know so I 

can
resign myself to the fact that it's never gonna change instead of 

hoping that

it's gonna be somewhere else every year.


To be honest, it's not entirely clear yet if we will change the 
location for
upcoming events. But could you explain why you didn't enjoy yourself at 
the

last one? How can we improve?

Bye,
LenZ
- --
Lenz Grimmer <[EMAIL PROTECTED]>
Community Relations Manager, EMEA
MySQL GmbH, http://www.mysql.de/, Hamburg, Germany
Visit the MySQL Forge at http://forge.mysql.com/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQFFuISeSVDhKrJykfIRAsJxAJ9hLkjhA10B68OHpw97x6QHbSqjLACePQym
m9lEE93nxdC+K//cQsL658Q=
=W/8N
-END PGP SIGNATURE-

Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: [OT} How to pronounce GIF

2007-01-19 Thread mizioumt

Hi,

gif will inevitably gravitate towards jif for the same reason SQL is 
sequel and lib, as in /usr/lib, is often 'libe'. The reasons
are described in the Appendix to Orwell's 1984 which is dedicated to 
newspeak, look for 'duckspeak' in particular,
and the consideration of 'Minitruethful' vs 'Minitrueful'. In other 
words the pronunciation will be such that
chances of the other party to actually think about its meaning be as 
little as possible. This is very good
in a job interview situation (I have no idea what TCP/IP means but I 
desperately need this job...) or
in IT salesman pitches which most of the time amount to 'give us your 
money in exchange for a lot of frustration
trying to use our product' but you're far more likely to hear words 
like Java, Internet or even whole nice
sounding expressions like 'closing the digital gap' or 'business 
intelligence' or 'globalization'.
Giraffe, on the other hand, could be pronounced in every which way 
possible unless uttering it
can gain you an advantage, I guess if you are biologists discussing 
giraffe breeding.


Thanks,
Michael

-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Sent: Fri, 12 Jan 2007 2:04 PM
Subject: Re: [OT} How to pronounce GIF

Brian Dunning wrote:

On Jan 7, 2007, at 4:23 PM, TK wrote:
>> In short, the original inventors of the GIF format (CompuServe, 
1987) >> have always defined the pronunciation to be like "JIF." So, 
that has >> always been the "correct" pronunciation.

> > Sure, so I'll start pronouncing "graphics" as "jraphics".
> How do you pronounce "giraffe"?


-- Gerald L. Clark
Supplier Systems Corporation

-- MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]



Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql on a NAS

2006-11-28 Thread mizioumt

Hi,

OCFS is a cluster filesystem so running two mysqld over the same OCFS 
directory is exactly the same
as running two mysqlds over the same directory in a local filesystem on 
the same machine which is

strictly prohibited.
If you decide to consider mysql clustering over ocfs please keep in 
mind thad you don't really need
cluster filesystem for mysql clustering. mysql clustering doesn't share 
disk storage. Considering
they use ocfs they may also be mistaken about the difference between 
mysql and oracle clustering.

Oracle cluster requires shared storage whereas mysql does not.

Thanks,
Michael

-Original Message-
From: [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Tue, 28 Nov 2006 12:59 PM
Subject: Re: mysql on a NAS

On Tue, 2006-11-28 at 17:58 +0100, Stefan Onken wrote:

Can you explain this a little bit more ? I am not the guy who set it
up, so I would like to go back them and say "Well, You cannot do
this, because... " :)


http://dev.mysql.com/doc/refman/5.1/en/multiple-servers.html describes
the pitfalls of running multiple servers on the same machine about
halfway down the page in the bold 'Warning' paragraph.
--
Pat Adams
Digital Darkness Promotions
Dallas Music Wiki http://digitaldarkness.com


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]

Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: finding NULL records

2006-11-17 Thread mizioumt

Thanks, I just couldn't remember English for 'ternary'.
Remembering the and/or tables for the logic became trivial
when I replaced 'NULL' for 'UNKNOWN' but 'UNKNOWN' doesn't exist
as an SQL keyword. I suspect the founding fathers chose NULL over
words like UNKNOWN to try avoid philosophical debates since there are 
at least
two meanings for null values, one that the data exists but is unknown, 
and another
that the data simply doesn't exist, such as date of death for a live 
person.
But I think this doesn't really belong to a mysql forum but rather to a 
general SQL discussion

so I'll try not to comment on that anymore.

Thanks,
Michael

-Original Message-
From: [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thu, 16 Nov 2006 2:55 PM
Subject: Re: finding NULL records

Hi all,

may I propose some slight corrections in wording ?
Inserted below at the appropriate places:

Jerry Schwartz wrote (re-ordered):

>> -Original Message-

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 15, 2006 2:22 PM
To: [EMAIL PROTECTED]; mysql@lists.mysql.com
Subject: Re: finding NULL records

[[...]]
This is what happens when one of the most innovative concepts of SQL
gets overlooked
or understressed which it seems to be in most modern SQL books.
The thing is that SQL's logic isn't binary. Rather it's built over
three values: TRUE, FALSE, NULL.


Nearly: The three values are typically called TRUE, FALSE, and UNKNOWN.
A logic based on three values is then called "ternary", AFAIR.


You can indeed compare anything to NULL:


You sure can, like you can compare apples to oranges - just the result 
is not meaningful.

In SQL, NULL is no value, it rather describes the absence of any value.

What often gets overlooked: "absence of value" is different from 
"empty", so an empty string is a non-NULL value !




x = NULL

in most systems is a valid syntax. The result is NULL if x is

 UNKNOWN

[[...]]


Even if it is valid syntax, you cannot really use it:
Comparing something known (some value) to something unknown (no value 
present) cannot give you any definite result,
so in SQL for *any* comparison operator "op" ( = < > <> ... LIKE ... ) 
and *any* known (= non-NULL) value x (column, literal, expression, ...) 
the result of

 x op NULL
is UNKNOWN.

As a rough analogy, consider comparing some visible object to one which 
is hidden behind a curtain:
You cannot tell whether they are identical or not, which one is larger, 
... , so the result is UNKNOWN. Especially, the result is *not* FALSE !


If such a predicate is used in a WHERE condition, like in
 SELECT x, y, z FROM tab WHERE x op NULL
then "x op NULL" evaluates to UNKNOWN, this is different from TRUE, and 
so the WHERE condition is not satisfied.




x IS NULL

on the other hand isn't a binary operator, it's an UNARY one with 

the

result values of TRUE or FALSE.


Correct.



The whole join theory obviously revolves around NULL treatment but
otherwise the NULL algebra becomes
fuzzy. I'm not sure what the standards say to the question of 

sorting

NULLs, or whether each null constitutes
a separate group as in GROUP BY, or all can be grouped together, but
the actual implementations
often make the answers configurable.


I don't have the standard at hand either, the only thing I remember is 
that it requires NULL to sort either less than or greater than all 
non-NULL values.

Beyond that, it often becomes implementation-dependant.



[[...]]



The result of all but two expressions will be NULL (not 0 or 1) if 

either
 UNKNOWN
side is NULL. The two exceptions are the operators IS NULL and IS NOT 

NULL.

> SELECT NULL = NULL; /* result is NULL */

 UNKNOWN

SELECT NULL IS NULL; /* result is 1, or TRUE */
SELECT NULL IS NOT NULL; /* result is 0, or FALSE */


Regards,
Joerg

-- Joerg Bruehe, Senior Production Engineer
MySQL AB, www.mysql.com


Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: finding NULL records

2006-11-17 Thread mizioumt

Well, I'm not sure about the exact definition of 'all'.

NULL OR TRUE  /* result is TRUE, example (NULL = NULL) OR (1 = 1) */

and so on. Didn't try to execute the actual SQL with such a close, 
though.


Thanks,
Michael

-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; mysql@lists.mysql.com
Sent: Wed, 15 Nov 2006 3:04 PM
Subject: RE: finding NULL records

The result of all but two expressions will be NULL (not 0 or 1) if 
either
side is NULL. The two exceptions are the operators IS NULL and IS NOT 
NULL.


SELECT NULL = NULL; /* result is NULL */
SELECT NULL IS NULL; /* result is 1, or TRUE */
SELECT NULL IS NOT NULL; /* result is 0, or FALSE */

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 15, 2006 2:22 PM
To: [EMAIL PROTECTED]; mysql@lists.mysql.com
Subject: Re: finding NULL records

trying to revive an old thread for fun...

> I inherited a system in which the code was writing the
string "NULL"
into
a
> CHAR field.

This is what happens when one of the most innovative concepts of SQL
gets overlooked
or understressed which it seems to be in most modern SQL books.
The thing is that SQL's logic isn't binary. Rather it's built over
three values: TRUE, FALSE, NULL.
You can indeed compare anything to NULL:

x = NULL

in most systems is a valid syntax. The result is NULL if x is
not NULL,
and the result of

NULL = NULL

I honestly don't remember, but it's either NULL or FALSE, definitely
TRUE.
The same goes for any other binary operator I can imagine.

x IS NULL

on the other hand isn't a binary operator, it's an UNARY one with the
result values of TRUE or FALSE.

The whole join theory obviously revolves around NULL treatment but
otherwise the NULL algebra becomes
fuzzy. I'm not sure what the standards say to the question of sorting
NULLs, or whether each null constitutes
a separate group as in GROUP BY, or all can be grouped together, but
the actual implementations
often make the answers configurable.

I wish SQL educators paid a little more attention to the math
of it. On
the other hand describing joins
in a kind of 'traditional' mathematics [no pictures, just symbols] is
definitely an overkill.

Thanks,
Michael

It took me a long time to figure out what MySQL CLI was
showing
> me.
>
> These kids today...

Oh my, sounds like a candidate for www.thedailywtf.com :-)


Martijn Tonies
Database Workbench - development tool for MySQL, and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
__
__
Check Out the new free AIM(R) Mail -- 2 GB of storage and
industry-leading spam and email virus protection.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]








Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: finding NULL records

2006-11-15 Thread mizioumt

trying to revive an old thread for fun...

I inherited a system in which the code was writing the string "NULL" 

into
a

CHAR field.


This is what happens when one of the most innovative concepts of SQL 
gets overlooked

or understressed which it seems to be in most modern SQL books.
The thing is that SQL's logic isn't binary. Rather it's built over 
three values: TRUE, FALSE, NULL.

You can indeed compare anything to NULL:

x = NULL

in most systems is a valid syntax. The result is NULL if x is not NULL, 
and the result of


NULL = NULL

I honestly don't remember, but it's either NULL or FALSE, definitely 
TRUE.

The same goes for any other binary operator I can imagine.

x IS NULL

on the other hand isn't a binary operator, it's an UNARY one with the 
result values of TRUE or FALSE.


The whole join theory obviously revolves around NULL treatment but 
otherwise the NULL algebra becomes
fuzzy. I'm not sure what the standards say to the question of sorting 
NULLs, or whether each null constitutes
a separate group as in GROUP BY, or all can be grouped together, but 
the actual implementations

often make the answers configurable.

I wish SQL educators paid a little more attention to the math of it. On 
the other hand describing joins
in a kind of 'traditional' mathematics [no pictures, just symbols] is 
definitely an overkill.


Thanks,
Michael

It took me a long time to figure out what MySQL CLI was
showing

me.

These kids today...


Oh my, sounds like a candidate for www.thedailywtf.com :-)


Martijn Tonies
Database Workbench - development tool for MySQL, and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]

Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Group By question

2006-08-31 Thread mizioumt

select * from t where emailaddress in
(select emailaddress from t group by emailaddress having count(*) > 1)
order by emailaddress;

Thanks,
Michael

-Original Message-
From: [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Wed, 30 Aug 2006 5:17 PM
Subject: Group By question

I have a table of people with one of the fields being the email 
address. I would like to query all rows that have more than one person 
with the same email address. For example if the data were like this...


A [EMAIL PROTECTED]
B [EMAIL PROTECTED]
C [EMAIL PROTECTED]
D [EMAIL PROTECTED]
E [EMAIL PROTECTED]
F [EMAIL PROTECTED]

The query would return row A, D, B, and E, in that order. It would not 
return C or F


-- Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want & give the gifts they want
One stop wish list for any gift, from anywhere, for any occasion!
http://thewishzone.com

-- MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]



Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysqlmanager logging?

2006-05-05 Thread mizioumt

Hi,

 you sort of suggest to look further beyond file permission problems 
but if I may:


> drwx--x--x 2 mysql mysql 1752 2006-05-01 09:33 mysql

doesn't look quite right, lack of read permissions to group/other.

Thanks,
Michael Izioumtchenko

-Original Message-
From: sheeri kritzer <[EMAIL PROTECTED]>
To: Duzenbury, Rich <[EMAIL PROTECTED]>
Cc: mysql@lists.mysql.com
Sent: Fri, 5 May 2006 16:00:05 -0400
Subject: Re: mysqlmanager logging?

su - mysql
touch /var/lib/mysql/mysqlmanager.log

see if that helps; maybe having the file there will kick it into gear.

Is mysqlmanager actually running? Is there a pid file?

-Sheeri

On 5/5/06, Duzenbury, Rich <[EMAIL PROTECTED]> wrote:
>
>
> > -Original Message-
> > From: sheeri kritzer [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, May 04, 2006 3:12 PM
> > To: Duzenbury, Rich
> > Cc: mysql@lists.mysql.com
> > Subject: Re: mysqlmanager logging?
> >
> > Can the program write to /var/lib/mysql/mysqlmanager.log?
> > check permissions.
> >
>
> # su - mysql
> [EMAIL PROTECTED]:~> whoami
> mysql
> [EMAIL PROTECTED]:~> cd /var/lib/mysql
> [EMAIL PROTECTED]:~> touch foo.txt
> [EMAIL PROTECTED]:~> ls -al
> total 3
> drwxr-xr-x 4 mysql mysql 120 2006-05-05 13:25 .
> drwxr-xr-x 56 root root 1472 2006-05-05 04:25 ..
> -rw-r--r-- 1 mysql mysql 0 2006-05-05 13:25 foo.txt
> drwx--x--x 2 mysql mysql 1752 2006-05-01 09:33 mysql
> drwxr-xr-x 2 mysql mysql 48 2006-05-01 09:33 test
>
> I don't think there is a permission problem.
>
> Any further ideas?
>
> Thanks.
>
> Regards,
> Rich
>

-- MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
 To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]



___
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]