Using an Alias column in the where clause in Postgresql

后端 未结 6 1187
轮回少年
轮回少年 2020-11-22 11:04

I have a query like this:

SELECT
    jobs.*, 
    (
        CASE
            WHEN lead_informations.state IS NOT NULL THEN lead_informations.state
                   


        
6条回答
  •  忘掉有多难
    2020-11-22 11:08

    SELECT "tab_1"."BirthDate", "tab_1"."col_1" FROM (
       SELECT BirthDate, DATEADD(year, 18, BirthDate) AS "col_1" FROM Employees
    ) AS "tab_1"
    WHERE "tab_1"."col_1" >= '2000-12-31';
    

提交回复
热议问题