Link to home
Start Free TrialLog in
Avatar of triphen
triphen

asked on

SQL Query Syntax

Hello Experts,

I am using SyBAse SQL Anywhere v10. This is my query

select top(1) CASHTIPS from TipPool where opendate = 20150601 order by LASTUPDATE desc

Open in new window


This works great except if CASHTIPS value is null, it returns a "0". I would like to return NULL if the result is NULL. I have tried to use case when but I cant figure out how to use that in conjunction with top

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Mike Eghtebas
Mike Eghtebas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of wilcoxon
wilcoxon
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of triphen
triphen

ASKER

Thanks!