473,466 Members | 1,336 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is this sql query possible???

Hello I want to make this query but I cannot figure it out.

Say if I have this table

SUP_ID DRV_ID
10000 A
11000 A
12000 A
20000 B
21000 B
30000 C
40000 D
50000 E

What I need is this

10000 A
20000 B
21000 C
40000 D
50000 E

Sup_ID does not really matter any supervisor(SUP_ID) will do. I just
need a list of unique DRV_ID.

Jan 18 '07 #1
3 1138
This gives exactly your result:
SELECT Min(SUP_ID) AS MinOfSUP_ID, DVR_ID
FROM tblEnrique
GROUP BY DVR_ID;

But if you only want the DRV_ID then you could use this:
SELECT DISTINCT DVR_ID FROM tblEnrique;

Cheers,
Jason Lepack

Enrique Rojas wrote:
Hello I want to make this query but I cannot figure it out.

Say if I have this table

SUP_ID DRV_ID
10000 A
11000 A
12000 A
20000 B
21000 B
30000 C
40000 D
50000 E

What I need is this

10000 A
20000 B
21000 C
40000 D
50000 E

Sup_ID does not really matter any supervisor(SUP_ID) will do. I just
need a list of unique DRV_ID.
Jan 18 '07 #2
SELECT First(tblName.SUP_ID) AS FirstOfSUP_ID, Samp.DRV_ID
FROM tblName
GROUP BY tblName.DRV_ID;

"Enrique Rojas" <en***********@gmail.comwrote in message
news:11**********************@a75g2000cwd.googlegr oups.com...
Hello I want to make this query but I cannot figure it out.

Say if I have this table

SUP_ID DRV_ID
10000 A
11000 A
12000 A
20000 B
21000 B
30000 C
40000 D
50000 E

What I need is this

10000 A
20000 B
21000 C
40000 D
50000 E

Sup_ID does not really matter any supervisor(SUP_ID) will do. I just
need a list of unique DRV_ID.

Jan 18 '07 #3
Thanks gentlemen...that worked.

paii, Ron wrote:
SELECT First(tblName.SUP_ID) AS FirstOfSUP_ID, Samp.DRV_ID
FROM tblName
GROUP BY tblName.DRV_ID;

"Enrique Rojas" <en***********@gmail.comwrote in message
news:11**********************@a75g2000cwd.googlegr oups.com...
Hello I want to make this query but I cannot figure it out.

Say if I have this table

SUP_ID DRV_ID
10000 A
11000 A
12000 A
20000 B
21000 B
30000 C
40000 D
50000 E

What I need is this

10000 A
20000 B
21000 C
40000 D
50000 E

Sup_ID does not really matter any supervisor(SUP_ID) will do. I just
need a list of unique DRV_ID.
Jan 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jonathan | last post by:
Hi all! For a match schedule I would like to find all possible combinations of teams playing home and away (without teams playing to themselves of course). I now the simple version works...
3
by: cassandra.flowers | last post by:
Hi, I was wondering if it is possible (Using access) to have a query parameter as a drop down box rather than a text box? e.g. typing as criteria for a query produces a box with a text box...
1
by: Michelle | last post by:
I have took another approach to my database and have created a field in my clients table with a 'client status' field, which is a combo box/value list that is a pulldown menu of 3 choices (active...
3
by: Ryan Hubbard | last post by:
I would like to run a query from VBA. The query will be one with parameters. Is there a way to run the query and have Access prompt for the values like it does if I where to execute it through...
3
by: Pea | last post by:
Is it possible to get the average in a query where I have multiple criteria? Here's an abbreviated example of the query in design view: Fields: USERID DATE TIME ID_TYPE...
4
by: d.p. | last post by:
Hi all, I'm using MS Access 2003. Bare with me on this description....here's the situation: Imagine insurance, and working out premiums for different insured properties. The rates for calculating...
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
2
by: jim Bob | last post by:
Hi, I have a query with the criteria of (!..) Or !.. When I provide the value from qmylist, a second pop up appears waiting for the value from lstResults. If I enter nothing and click ok, it...
13
by: forbes | last post by:
Hi, I have a user that used the Query Wizard to create a query in Access. Now she claims that her master table is missing all the data that was excluded from the query. Can you create anything...
5
by: jonm4102 | last post by:
I'm trying to calculate the median of some numerical data. The data can only be found in a query (henceforth query 1) field I previously made, and I would prefer to calculate the median in a new...
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
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.