473,396 Members | 2,010 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,396 software developers and data experts.

Count of records inside the records but based on distinct?

2
I need help. I have a table that I need 7 things from.

So I have a table that i'm retrieving RecordID, UserDate, Ticket#, Description, EnterDate, Area, and Type from (not the real names, but it doesn't matter.

Here's the problem. I need to retrieve records where there are 3+ instances of type that are the same in an area, and then those three+ corresponding ticket# fields should each be different. So it could be like

Type Ticket# Area
Computer 1b MN
Computer 1c MN
Computer 1c LA
Computer 1e MN
Computer 1a LA
Laptop NULL GE
Laptop 2b TI
Laptop 2b TI
Laptop 1a UT
Monitor 3g NV
Monitor 3p NV
Monitor 3m NV

etc. Of this, I would want a result that returned
Type Ticket# Area
Computer 1b MN
Computer 1c MN
Computer 1e MN
Monitor 3g NV
Monitor 3p NV
Monitor 3m NV

Because they were the only ones with three unique ticket# fields for 3+ possible Type's of the same type.

On top of that, I need to display the corresponding information of RecordID, UserDate, Description, EnterDate, and Area for each record.

I believe the closest thing I can do with it involves a self join for ticket# and Type, but so far, for the life of me, i can't figure out how to make sure that there are at least 3 listed (in the area) and that the three types are different. Anyone?
Aug 4 '06 #1
0 1387

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

Similar topics

2
by: Paxton | last post by:
Hi, I'm trying to display the total page views per page within a given date range, but the correct SQL is seemingly beyond me. I get the correct result with a straightforward Group By and Count...
5
by: Terri | last post by:
I have a form with a multi-select combo. I dynamically build a SELECT statement, open a report, and set the recordsource to my dynamic SELECT statement. I count the records returned in the report...
2
by: SJM | last post by:
I have a report that displays records of real estate properties. It is possible for each property to appear a number of times for various reasons. Each record however is unique. What I would like...
2
by: Paula | last post by:
A query contains the fields CustomerID, CustomerName, OrderID, OrderDate and ItemID. The query is based on a customers table, orders table, and order details table. The orders table has a foreign...
4
by: Mina Patel | last post by:
Hi trying to find the number of duplicate tuples/records in table based on multiple columns ie. select count(distinct list multiple column key ) from x where date = y HAVING ( COUNT(multiple...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
1
by: Bill | last post by:
I'm trying to write a query that will select a distinct count of more than one field. I have records that display user productivity. Each of the records have a time associated with it and I want to...
7
by: AccessHunter | last post by:
Hi, Please help with this problem. I have a report that displays a list of Case/Judge Records. using the following fields, Case Nbr, Case Seq Nbr, Judge Name, Attorney name 723187, 1...
4
by: tom booster | last post by:
Hi All, I'm trying to convert a T-SQl query to DB2. I have two tables policy and policyHolder. I would like a count of the amount of distinct poicyHolders per policy, for a particular set of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.