Re: printing columns other than the search criteria

From: Jerry Stuckle <jstucklex_at_attglobal.net>
Date: Tue, 8 Nov 2016 08:23:27 -0500
Message-ID: <nvsjjh$da7$1_at_jstuckle.eternal-september.org>


On 11/7/2016 11:32 PM, Eric wrote:
> I have a mysql query like this
> Select * from archive where rain > '{0}
>
> but i want to print some other fields with it if rain is > 0
>
> So what i want is something like
>
> Select * from archive where rain > '{0}' print _at_datetime @baro
>
> The criteria determines the row but the data printed isn't the criteria
> its some of the other columns depending on the criteria specified.
>
> Thanks
>

As Axel said, 'Select *' is not good. You should specify each column you wish to print.

But what you want is not clear. You are already retrieving all of the columns in the table. Where does the other data come from? Better yet, what is your table definition, some sample data and the exact output you want?

You should be able to do it with something like a UNION, but more information is needed.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex_at_attglobal.net
==================
Received on Tue Nov 08 2016 - 14:23:27 CET

Original text of this message