sql - How to select distinct by 2 fields -


i need able select records have isactive = 1 in addition of this:

select distinct 0 communityid,                        case libname                         when 'rkhl' 'rock hill'                         when 'ftml' 'fort mill'                         when 'lanc' 'lancaster'                         when 'brev' 'brevard'                         when 'pbtc' 'midlands-clec'                         when 'pbti' 'midlands-ilec'                      end communitydesc,                      libname,                     libname + '|' filterbyid,                     isactive                      reference.dbo.community                     libname <> 'carotel'                      union                     select communityid, rtrim(commname) communitydesc, libname, libname + '|' + rtrim(commname) filterbyid, isactive                     reference.dbo.community                       libname <> 'carotel'                     order 1,3; 

add isactive=1 clause on both sides of union.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -