shadkeene
11-07-2007, 11:19 PM
Hi,
I have two tables that have values that I want to compare.
So far, I've been testing my database design to see if it can achieve what I'd like to do.
I'm sure my design is far from perfect, but I've been able to join tables so far.
So, I have two tables that I've been using timestamp as their primary key. I'm trying to subtract values from columns shft_summary.CANX and coldseason.LOCLDTIME by using the following:
select (CANX from shft_summary where date_time='2007-11-06 13:00:00')-(LOCLDTIME from coldseason where date_time='2007-11-06 07:50:00');
Am I missing something? Do I need to join the two tables before subtracting?
Oh, and another thing...the data type in shft_summary.CANX and coldseason.LOCLDTIME are char. Am I correct that mysql still subtracts char datatypesas long as the content of the column is numeric?
Thanks for any help.
I have two tables that have values that I want to compare.
So far, I've been testing my database design to see if it can achieve what I'd like to do.
I'm sure my design is far from perfect, but I've been able to join tables so far.
So, I have two tables that I've been using timestamp as their primary key. I'm trying to subtract values from columns shft_summary.CANX and coldseason.LOCLDTIME by using the following:
select (CANX from shft_summary where date_time='2007-11-06 13:00:00')-(LOCLDTIME from coldseason where date_time='2007-11-06 07:50:00');
Am I missing something? Do I need to join the two tables before subtracting?
Oh, and another thing...the data type in shft_summary.CANX and coldseason.LOCLDTIME are char. Am I correct that mysql still subtracts char datatypesas long as the content of the column is numeric?
Thanks for any help.