Re: printing columns other than the search criteria
From: The Natural Philosopher <tnp_at_invalid.invalid>
Date: Tue, 8 Nov 2016 08:18:58 +0000
Message-ID: <nvs1pc$73s$1_at_news.albasani.net>
Date: Tue, 8 Nov 2016 08:18:58 +0000
Message-ID: <nvs1pc$73s$1_at_news.albasani.net>
On 08/11/16 04:32, 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
>
I think you can only do this at application level. The output of a mysql
query is always a table, with a fixed number of fields in te row,
SQL query can render the columns blank, or NULL, by conditional selection*, but it cant make the field disappear.
*SELECT...IF(......)..
-- Microsoft : the best reason to go to Linux that ever existed.Received on Tue Nov 08 2016 - 09:18:58 CET