Join problem, Please help.

2002-04-01 Thread IvanLatysh

Hi.
I am running MySQL 3.23.44-Max

I have 2 tables.

Table "A"
+---++
 IDName
+---++
  1 string 1
  2 string 2
+---++

Table "B"

+---++
 IDName
+---++
  2 string 2
  3 string 3
+---++

And I need result
 +---++
 IDName
+---++
  1 string 1
  2 string 2
  3 string 3
+---++
How I could get (my version of mySQL haven't UNION statement)

Sincerely yours, Ivan Latysh.
[EMAIL PROTECTED]
http://ivan.yourmail.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




ALTER TABLE & Foreign key problems

2002-03-06 Thread IvanLatysh

Hi.
I am using MySQL 3.23.44-max and InnoDB tables.
I also using foreign key in my tables.
I have problem, I couldn't alter my table and add any foreign keys.
SQL like this: alter table data_entry add FOREIGN KEY (data_task_id) REFERENCES
data_task(identity);
give me any error but key doesn't created.
If I am creating table with foreign key - all is ok.

Sincerely yours, Ivan Latysh.
[EMAIL PROTECTED]
http://ivan.yourmail.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: A sum of a few columns in where clause?

2002-02-15 Thread IvanLatysh

 >> I've got query like this:

 >> "select count(ID) from TABLE where (TABLE.A + TABLE.B + TABLE.C +
 >> TABLE.D) > 0"

 >> A,B,C,D are decimal values.

 >> The problem is, I think, with NULL columns. Often B,C and D don't
 >> have decimal value, but NULL.
 >> I thought, that this should be counted like zero. Am I wrong ?

 RB> NULL is not the same as zero.

 RB> If any of the field values are NULL, the result of the expression is
 RB> NULL.

Hey guys Is this so hard to help people instead of killing them ?

Use IFNULL(null_field, 0)

And your query will be like:
select count(ID) from TABLE where (IFNULL(TABLE.A, 0) + IFNULL(TABLE.B, 0) + 
IFNULL(TABLE.C, 0)
+  IFNULL(TABLE.D,0)) > 0

And I advice you - RTFM.

---
Yours sincerely, Ivan Latysh.
[EMAIL PROTECTED]
http://ivan.yourmail.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Do MySQL are going to support NULL value for foreign key fields (in case parent are not null)

2002-02-13 Thread IvanLatysh

Hi All.

Do MySQL are going to support NULL value for foreign key fields (in case parent are 
not null)

I didn't found any mentions about this problem in news or somewhere else.
If you have any kind of info please answer. 
Because so hard to use foreign keys without this option.

Sincerely yours, Ivan Latysh.
[EMAIL PROTECTED]
http://ivan.yourmail.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




MySQL + InnoDB + fereign keys

2002-01-08 Thread IvanLatysh


Hi.
I am using MySQL 3.23.44-MAX. with InnoDB

I have create two tables (one of them parent, other child).
All seems Ok. But when I am trying to insert new record into the table I am getting key
violation.
It happened when I am trying insert null value into field that have foreign key. 
(column could
be null)
I am tried to find any mention over the net, but I haven't found any mentions about 
this.


Sincerely yours, Ivan Latysh.
[EMAIL PROTECTED]
http://ivan.yourmail.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php