Click here to Skip to main content
15,946,525 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Every One,

I have two table article and category

table :article
columns:
category_id
article_title 

table :category
columns:
category_id
category_name 


i want to show record in repeater control Like as follows:

category name1 
	1. article title1
	2. article title2
	3. article title3

category name2 
	1. article title4
	2. article title5
	3. article title6


I want to reterive records by using grouping of category name.
Please tell me what query will be use for this.
if any one know please tell me.
Posted
Updated 3-Jun-12 21:07pm
v2

1 solution

Hi,

The following query will be useful.
select category_id,article_id category left outer a join article b on a.category_id = b.category_id group by category_id,article_id

One thing to note that, while grouping, you have to select the fields which you are using for grouping. Or else it will throw error.

Happy Coding :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900