0

I have the following query:

   SELECT target,
   
   CASE
       WHEN var_10 >1.5 AND var_10 <2.5 THEN 1 
   END as var_10_bck,

Then I want to use this new created variable "var_10_bck" in the same query that continues as :

   CASE
       WHEN var_10_bck <2 THEN 0
   END as var_10_new

   FROM database
artur
  • 13
  • 3
  • As a side note: that's not a "variable" it's a column (or column alias). And you select FROM a table, not a database. –  Jul 20 '22 at 08:11
  • @a_horse_with_no_name funny fuct, my table is called 'database' – artur Jul 20 '22 at 08:15
  • That's a really disturbing naming convention –  Jul 20 '22 at 08:22

0 Answers0