SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Select statement to output two linked tables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

amerbashoeb
Starting Member

14 Posts

Posted - 01/18/2010 :  20:53:03  Show Profile  Reply with Quote
Hello there,

I having been sitting whole day to figure out how to write a sql query to display result in the following manner.

CategoryID
1
ArticleID Title CategoryID
1 fried rice recipe 1

CategoryID
2
ArticleID Title CategoryID
2 party at tiger club 2
3 party at zebra club 2
4 party at lion club 2

CategoryID
3
ArticleID Title CategoryID
5 how to spend money 3
6 how to save money 3

I am sure there is way in sql to do this?

Edited by - amerbashoeb on 01/18/2010 20:54:39

tkizer
Almighty SQL Goddess

USA
35954 Posts

Posted - 01/18/2010 :  21:42:43  Show Profile  Visit tkizer's Homepage  Reply with Quote
Do that type of formatting in your application or report.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

amerbashoeb
Starting Member

14 Posts

Posted - 01/19/2010 :  06:12:33  Show Profile  Reply with Quote
thank you Kizer
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000