473,397 Members | 1,985 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,397 software developers and data experts.

filter unique and exclude duplicates

I have been working on a database to perform some of the tasks that I
have been doing manually in Excel. One of those tasks is to sort and
exclude duplicate data. The fields are as follows

Building
Name or letter
Floor
MAC
Channel
SSID
RSSI
WEP

I would like to perorm the same actions I did in excel but use an
Access query. The actions I performed in Excel are below.

Select ALL and click data->sort->header row, MAC-ascending,
RSSI-descending
Select the "MAC" column and click Data->filter->Advanced
Filter->unique recorders

The sorting part seems pretty easy, but I can't figure out how to
remove all but the first record of each MAC.

The purpose of the query is to display the floor with the highest RSSI
number. This would tell me where to find each Wireless AP.

Any help is appreciated

Thanks,
Mark

Nov 12 '06 #1
4 8922

ninrulz wrote:
I have been working on a database to perform some of the tasks that I
have been doing manually in Excel. One of those tasks is to sort and
exclude duplicate data. The fields are as follows

Building
Name or letter
Floor
MAC
Channel
SSID
RSSI
WEP

I would like to perorm the same actions I did in excel but use an
Access query. The actions I performed in Excel are below.

Select ALL and click data->sort->header row, MAC-ascending,
RSSI-descending
Select the "MAC" column and click Data->filter->Advanced
Filter->unique recorders

The sorting part seems pretty easy, but I can't figure out how to
remove all but the first record of each MAC.

The purpose of the query is to display the floor with the highest RSSI
number. This would tell me where to find each Wireless AP.

Any help is appreciated

Thanks,
Mark
Use a SELECT query. Add the DISTINCT clause and you're good to go.

SELECT DISTINCT Field1, Field2,...
FROM MyTable
WHERE Field1='Whatever'
ORDER BY Field1, Field2...

Nov 12 '06 #2
Ok, so here is my code. I am not sure what I would put after the WHERE=
I have numerous MAC addresses with different RSSI values. I would like
to display only the rows with unique MAC adresses and the lowest RSSI
value.

SELECT DISTINCT Scan1.MAC, Scan1.RSSI, Scan1.Building, Scan1.[Name or
Letter], Scan1.Floor, Scan1.Channel, Scan1.SSID, Scan1.WEP
FROM [Scan - sort test] AS Scan1
GROUP BY Scan1.MAC, Scan1.RSSI, Scan1.Building, Scan1.[Name or Letter],
Scan1.Floor, Scan1.Channel, Scan1.SSID, Scan1.WEP
ORDER BY Scan1.MAC, Scan1.RSSI DESC;

Thanks for your help
Mark

pi********@hotmail.com wrote:
ninrulz wrote:
I have been working on a database to perform some of the tasks that I
have been doing manually in Excel. One of those tasks is to sort and
exclude duplicate data. The fields are as follows

Building
Name or letter
Floor
MAC
Channel
SSID
RSSI
WEP

I would like to perorm the same actions I did in excel but use an
Access query. The actions I performed in Excel are below.

Select ALL and click data->sort->header row, MAC-ascending,
RSSI-descending
Select the "MAC" column and click Data->filter->Advanced
Filter->unique recorders

The sorting part seems pretty easy, but I can't figure out how to
remove all but the first record of each MAC.

The purpose of the query is to display the floor with the highest RSSI
number. This would tell me where to find each Wireless AP.

Any help is appreciated

Thanks,
Mark

Use a SELECT query. Add the DISTINCT clause and you're good to go.

SELECT DISTINCT Field1, Field2,...
FROM MyTable
WHERE Field1='Whatever'
ORDER BY Field1, Field2...
Nov 13 '06 #3
I'm probably barking up the wrong tree here, but I have not idea what
to do.

I created a Make Query and used MAX to display the highest RSSI for
each MAC address. I could not display the floor in the query because
the results would come out wrong. I was able to display the correct
results with the code below.

SELECT Scan.Building, Scan.[Name or Letter], Scan.MAC, Scan.Channel,
Scan.SSID, Max(Scan.RSSI) AS MaxOfRSSI, Scan.WEP INTO [Scan - sort
test]
FROM Scan
GROUP BY Scan.Building, Scan.[Name or Letter], Scan.MAC, Scan.Channel,
Scan.SSID, Scan.WEP
ORDER BY Scan.MAC, Max(Scan.RSSI) DESC;

However, the floor is important and I can't figure out how to add that
back into the query. I tried joining the 2 tables and throwing the
floor back in. I end up with 2 identical results for each of the rows.
The code for the second query is below.

SELECT [Scan - sort test].Building, [Scan - sort test].[Name or
Letter], Scan.Floor, [Scan - sort test].MAC, [Scan - sort
test].Channel, [Scan - sort test].SSID, [Scan - sort test].MaxOfRSSI,
[Scan - sort test].WEP
FROM [Scan - sort test] INNER JOIN Scan ON [Scan - sort test].MaxOfRSSI
= Scan.RSSI;

Any advice?

Thanks,
Mark

Nov 13 '06 #4

Try using a subquery. Something like:

SELECT Scan.Building, Scan.[Name or Letter], Scan.MAC, Scan.Channel,
Scan.Floor,
Scan.SSID, Scan.WEP FROM Scan
where Scan.SSID = (select max(b.ssid) from Scan b where b.MAC =
Scan.MAC)

Nov 13 '06 #5

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

Similar topics

5
by: Westcoast Sheri | last post by:
Which will be a faster lookup of an item by, "color" in the following mySQL tables: "unique key," "primary key," or just plain "key"?? CREATE TABLE myTable ( number int(11) NOT NULL default '0',...
3
by: Bob | last post by:
Why, in the process of creating a unique index, does SQL Server allow me to select the "Ignore duplicate keys" option? Wouldn't I just create a non-unique index if I wanted to ignore duplicate...
3
by: Shawn | last post by:
Hi guys, I'm trying to compose a query that will select all columns from a table, but without any duplicates. E.g. table name is 'tblShipment' columns are: fldUnique(pk) | fldShipNo |...
5
by: Abhishek Pandey | last post by:
Hi, I have a vector of strings. I want to hold it only unique strings. That is, before adding any new string, I want to check if it is already present, and if yes, then I will not add the new...
9
by: Rich S. | last post by:
Hi In an earlier posting I was asking how to read thru millions of data records keeping the top 2000 (where the top values are based upon a field in the record) and niklasb suggested using a...
11
by: Bob | last post by:
I am in the process of upgrading an Access database to SQL Server (and climbing that learning curve!). The wizard happily upgraded all the tables and I can link to them OK using ODBC. The...
5
by: EP | last post by:
This inquiry may either turn out to be about the suitability of the SHA-1 (160 bit digest) for file identification, the sha function in Python ... or about some error in my script. Any insight...
10
by: Laurence | last post by:
Hi there, How to differentiate between unique constraint and unique index? These are very similar but I cannot differentiate them? Could someone give me a hand? Thanks in advance
11
by: sqlservernewbie | last post by:
Hi Everyone, Here is a theoretical, and definition question for you. In databases, we have: Relation a table with columns and rows
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
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...

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.