Re: Multiply one column by another?

From: Albert L. Evans, IV <ae0i+_at_andrew.cmu.edu>
Date: Fri, 30 Oct 1992 09:53:25 -0500
Message-ID: <QewIlZS00WB21Fe0Vq_at_andrew.cmu.edu>


Hugh,

What you want to do is a join on your three tables. The following statement should work if I understand your tables correctly:

SELECT scalar_val*slope FROM scalars, data_types, units WHERE scalars.dattype_id=data_types.id AND
data_types.units_id=units.id

I'm not sure what the actual conversion equation is (whether you need the offset you talk about or not), but the above statement should reference the appropriate row in the units table, so you would only need to modify the SELECT to say scalar_var*slope*offset or whatever. Let me know if this doesn't work or you continue to have problems.

Bert Received on Fri Oct 30 1992 - 15:53:25 CET

Original text of this message