-
Feb 20th, 2012, 10:59 AM
#1
Thread Starter
New Member
listview and sql
i want to show total counts of records in listview with sql
the records
column1 ,column2
row1 record1 1
row2 record1 2
row3 record1 3
row4 record1 4
row5 record1 5
row6 record2 1
row7 record2 2
row8 record2 3
will be shown like this :
column1 , column2
row1 record1 5
row2 record2 3
is it possible ?
-
Feb 20th, 2012, 11:42 AM
#2
Re: listview and sql
Welcome to the forums
Easy enough. Build your SQL statement to use GROUP BY statement and a count. In your example, it would return just 2 records, one with a count of 5 and another with a count of 3. Transfering those returned records to a listview is easy enough
If you are having problems with your SQL statement, you may want to post that. If you are not familiar with a listview, search the forum for example usage
-
Feb 22nd, 2012, 06:30 AM
#3
Thread Starter
New Member
Re: listview and sql
thanks i solved by using "group by" and "having count"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|