473,394 Members | 1,645 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Collect and show one type?

80
Hi All!
I have a product catalogue in MSSQL, now I would like to make a function that search the database and shows a list of each brands and how many rows the brand have been found.

Something like:
Acer (33)
Sony(15)
.. And so on..

Can anyone picture me the best way to do so?

Regards.
Frederik
Jan 10 '11 #1

✓ answered by Rabbit

You mean like a count grouping by brand?
Expand|Select|Wrap|Line Numbers
  1. SELECT Brand, Count(*) FROM Table1 GROUP BY Brand

6 1602
Rabbit
12,516 Expert Mod 8TB
You mean like a count grouping by brand?
Expand|Select|Wrap|Line Numbers
  1. SELECT Brand, Count(*) FROM Table1 GROUP BY Brand
Jan 10 '11 #2
Pheddy
80
Well yeah, but it has to be a function that search for any brands in the column "Brands" and then Counts how many of these there are. So I wouldnt need to specify which brands to count beforehand..
Jan 12 '11 #3
Rabbit
12,516 Expert Mod 8TB
You don't have to specify which brands to count beforehand.
Jan 12 '11 #4
Pheddy
80
Guess i'm a little confused. Im not sure how to print the values?
Jan 12 '11 #5
Rabbit
12,516 Expert Mod 8TB
You would probably just loop through the recordset and write the values.
Jan 12 '11 #6
Pheddy
80
I see now Thanks.
Jan 12 '11 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jax | last post by:
I'm having difficulty with creating dynamic types, TypeBuilder is attained through module builder which in turn comes from assembly builder. I assumed that if you save the assembly you'd save the...
0
by: groves | last post by:
Have a client who wants a kiosk-type application to show local weather images (like radar animations) and scrolling text across the screen. This will be broadcast on a television station. We...
7
by: Sky | last post by:
I have been looking for a more powerful version of GetType(string) that will find the Type no matter what, and will work even if only supplied "{TypeName}", not the full "{TypeName},{AssemblyName}"...
4
by: c676228 | last post by:
Hi everyone, I need to write a insruance program which needs to collect multiple people information, The information for each person includes name, email, address, phone, dob etc. The DOB data...
1
by: devmiral | last post by:
Hello every one I trying simple bulk collect , it is giving me an error in oracle 9i, i wroe as per book and on the web deatils about bulk collect declare type emp_type is table of emp%rowtype;...
7
by: Michael Bray | last post by:
Let's say I am using reflection to analyze my classes, and I have an array of another class. How do I get the base class that forms the array from a type? public class A { } A MyArray =...
1
by: empiresolutions | last post by:
Hello fellow code junkies, I am using the "Ajax dynamic list" http://dhtmlgoodies.com/index.html?whichScript=ajax-dynamic-list and i think its the best out there. I have found a compatibility...
48
by: Ward Bekker | last post by:
Hi, I'm wondering if the GC.Collect method really collects all objects possible objects? Or is this still a "smart" process sometimes keeping objects alive even if they can be garbage collected?...
4
by: shelley_2000 | last post by:
What is the best approach to collect and load Employee Resume Data from External Employees who may not have Microsoft access? If is likely they will have Microsoft Word, but not Microsoft Access. ...
1
by: judy | last post by:
I have several databases that are used to collect data for different client-projects. My intention was to collect the data, and administer mySQL so each client could see only their data. Each of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.