Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
stev1ef
Starting Member
3 Posts |
Posted - 2010-09-07 : 11:22:47
|
Hi, I want to write a select subquery.Basically if I have a list of fields I am calling, i.e.selectu.user, ua.ip,u.log... etcfrom user u join useraccess ua etc.I want to write an subquery that will return nothing, i.e. ‘’, or if the u.loginname value is like ‘ut%’ then what is in the field u.loginnameI’ve tried writing if/else statements, case statements and creating a variable but I can’t get it to work?Any help would be appreciated??If anyone needs more info to help me out Let me know and I'll gladly provide.ThanksSteve |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-09-07 : 12:06:50
|
selectu.user,case when u.loginname like 'ut%' then u.loginname else ''end as loginname,ua.ip,...from ... No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|