I know that in SQLite, we use the LENGTH function instead of len. But when I want to use the LENGTH function with a subquery like so:
select length(select name from tblNames where name=1)
I receive an error. Here is the Microsoft SQL version of the expression:
iif(len((select BilgiAcik from DigerBilg where BilgTip=12 and BilgDgr=Cstr(Dr.Fr)))>0,( select BilgiAcik from DigerBilg where BilgTip=12 and BilgDgr=Cstr(Dr.Fr)),Cstr(Dr.Fr)) as Fr,
I converted the above expression into SQLite as so:
(case length((select BilgiAcik from DigerBilg where BilgTip=12 and BilgDgr=CAST(Dr.Fr as TEXT))>0 ( select BilgiAcik from DigerBilg where BilgTip=12 and BilgDgr=Cstr(Dr.Fr)) else CAST(Dr.Fr as TEXT) end) as Fr,
What I’m I doing wrong about? Can’t I just use the SUBSELECT query with the LRNGTH function? Any suggestions on how to solve this problem?
You will want to restructure your statement to be more similar to the following.
You can manage this a bit more easily by aliasing the subselects if you like.