Closed Zheng7AI310 closed 4 years ago
You can handle it with two conditions:
WHERE (age = '> 89' OR CAST(age AS NUMERIC) > 16)
sorry. The code didnot matter. Error results:nvalid type numeric input syntax: ""
------------------ Original message ------------------ From: "Alistair Johnson"; Sendtime: Monday, Jun 8, 2020 9:24 PM To: "MIT-LCP/eicu-code"; Cc: "郑瑞"1499975603@qq.com; "Author"; Subject: Re: [MIT-LCP/eicu-code] age (#134)
You can handle it with two conditions:
WHERE (age = '> 89' OR CAST(age AS NUMERIC) > 16)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Yeah I think instead you'll have to make an in-line view:
WITH pt_age AS
(
SELECT patientunitstayid, age,
CASE WHEN age = '> 89' THEN 89
WHEN TRIM(age) = '' THEN NULL
ELSE CAST(age AS NUMERIC)
END AS age_numeric
FROM `physionet-data.eicu_crd.patient` pt
)
...
thanks!
------------------ Original message ------------------ From: "Alistair Johnson"; Sendtime: Monday, Jun 8, 2020 10:36 PM To: "MIT-LCP/eicu-code"; Cc: "郑瑞"1499975603@qq.com; "Author"; Subject: Re: [MIT-LCP/eicu-code] age (#134)
Yeah I think instead you'll have to make an in-line view:
WITH pt_age AS ( SELECT patientunitstayid, age, CASE WHEN age = '> 89' THEN 89 WHEN TRIM(age) = '' THEN NULL ELSE CAST(age AS NUMERIC) END AS age_numeric FROM physionet-data.eicu_crd.patient
pt ) ...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
There is a Column of age in icustay_detial. There is a string variable of'>89' in age.,what caused me to have trouble extracting adult patients. SQL statement 'where age>16 'will report an error. May I ask how to solve this.