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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 join(solved)

Author  Topic 

gagani
Posting Yak Master

112 Posts

Posted - 2011-10-17 : 14:13:16
Hi,

I want to join

select branchid, branchname from salesbranches where active = 1 order by branchname

select branchid, branchname+'*' from salesbranches where active = 0 order by branchname

firstly, I need active branches to come in order, then inactive branches to come in order

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-17 : 14:16:19
[code]
select branchid, branchname + case when active = 0 then '*' else '' end
from salesbranches
order by active desc,branchname
[/code]

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

gagani
Posting Yak Master

112 Posts

Posted - 2011-10-17 : 14:29:14
so great of you. Thank you so much
I did not find any option to mark it as complete
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-17 : 14:31:01
no need. just append [Solved] to topic heading and that should be it

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -