Filter results of column alias in SELECT statement
Hello my friends. I have been unable to figure out this problem. I am trying to filter the SAPMERCHVDIVISIONCODE alias in the statement below. I only want data with a value of 806 in this column. Is it possible to do within the same statement? If not, what would the separate statement look like. Thanks so much!!
PSPLN As TASK,
CAST(LEFT(PSSYR || PSSTYL || PSSSFX,3) AS INTEGER) AS SAPMERCHDIVISIONCODE,
PSSYR || PSSTYL || PSSSFX AS SKU,
THEN TRIM(PSAREA) || TRIM(PSZONE) || Left(TRIM(PSAISL),1) || Right(TRIM(PSAISL),1) || TRIM(PSBAY)
Re: Filter results of column alias in SELECT statement
Thank you for the quick response Anders. Unfortunately this does not work for some reason. I thought if I added “AS SAPMERCHDIVISIONCODE” to the end of the statement that you provided it might work, but the word AS is not recognized.