I am trying to remove any duplicate value and display just the unique values using the select query below. I need the select query to display just the distinct values based on Member.ID - SELECT MEMBER.ACCT, MEMBER.NACD, MEMBER.FRST, MEMBER.ID, MEMBER.LAST, MEMBER.MID, ORDER.BAL, ORDER.TYPE, ORDER.TINUM
-
FROM MEMBER INNER JOIN ORDER ON MEMBER.ACCT = ORDER.SHACCT
-
WHERE (SELECT DISTINCT MEMBER.ID FROM MEMBER) AND ((ORDER.BAL)>0) AND ((ORDER.TINUM)=1);
Note: ID is not a primary key but it's a unique number to each record
14 2703 NeoPa 32,566
Recognized Expert Moderator MVP
You probably want SELECT DISTINCT in line one.
If that's not what you want, then you need to ask the question more clearly, as this doesn't make much sense.
I tried it with Select Distinct when I initially started the query but it does not provide the unique records I am after.
Basically what I am trying to achieve is; from the member table retrieve the rows listed but in the list being retrieved select only the distinct records based on the Member.ID ( kind of like in excel when you remove or delete duplicate records based on a certain column). The Member.ID may be associated with multiple records but I want to get rid of the duplication and display just one unique record of the member.id row.
I hope my explaination makes sense??
If Member.ID is associated with multiple records then how can it display one unique record as some of the fields will have multiple values, surely? Unless I'm missing something blindingly obvious...
NeoPa 32,566
Recognized Expert Moderator MVP
Maybe if you posted some example input and required output data it may become clearer what you're after. I suspect we may be talking about a GROUP BY clause in place of the DISTINCT predicate here, but there's simply too little information to be sure.
NeoPa 32,566
Recognized Expert Moderator MVP @hedges98
I doubt it's you Hedges. Let's see what the OP comes up with in the way of example data and maybe the request will make more sense.
Remember, many of our members are very inexperienced at this level. Most progress over time.
Remember, many of our members are very inexperienced at this level. Most progress over time.
helloooooooo!
*waves*
NeoPa 32,566
Recognized Expert Moderator MVP
And you're a perfect example of course :D
The following is a sample of the data I am getting; you will notice that based on the primary keys in this case 2345, 7321 and 4323 there are three records being retrieved by the query. What I want it to retrieve is just one of the records based on the Member.ID in this case 34687921 (this is not the primary key)
2345 THOMAS ADAMS 34687921
7321 HERMAN CORP 34687921
4323 JOE TORY TOM 34687921
Currently I am having to export the results to excel and then delete the duplicates based on the Member.ID row.
thanks for all your help
So what is the desired output you are looking for? Is there a particular record you want to display based on Member.ID or do you just want any one record to be displayed?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: mike420 |
last post by:
In the context of LATEX, some Pythonista asked what the big
successes of Lisp were. I think there were at least three *big*
successes.
a. orbitz.com web site uses Lisp for algorithms, etc.
b. Yahoo store was originally written in Lisp.
c. Emacs
The issues with these will probably come up, so I might as well
mention them myself (which...
|
by: Marc Scheuner [MVP ADSI] |
last post by:
Folks,
I'm struggling with XSLT key's and stuff.... anybody out there who
*REALLY* understands this stuff???
Okay, my XML file looks something like this (partially):
<?xml version="1.0" encoding="ISO-8859-1"?>
<report>
<meta>
|
by: Johnathan Doe |
last post by:
I can google search to find the range of values that can be represented
in a float by reading up on the IEEE std, but is that the same as how
many distinct values that can go in a float type?
For instance, floats can distinguish 0.000001 and 0.000002. If I
started with 0.000001 and kept adding 0.000001 until I hit some maximum
value...
|
by: Sean Shanny |
last post by:
To all,
Running into an out of memory error on our data warehouse server. This
occurs only with our data from the 'September' section of a large fact
table. The exact same query running over data from August or any prior
month for that matter works fine which is why this is so weird. Note that
June 2004 through today is stored in the same...
|
by: zaphod |
last post by:
I need to select unique combinations of 4 columns from one table and insert
them into a new table but I can't think of any way of finding unique
combinations of more than 1 column since SELECT DISTINCT only works on
single columns. Any ideas?
zaphod
| |
by: vvyshak |
last post by:
Hi all...
I have a table in which some columns has distinct values and some has
duplicates..i wan to select all the columns with distinct values....no
problem if rows has null value in it....i tried a lot wit distinct and
group by but nothing got worked out...
Waitin for your reply.....
Thanking you...
|
by: Chuck Faranda |
last post by:
I'm trying to debug my first C program (firmware for PIC MCU). The problem
is getting serial data back from my device. My get commands have to be sent
twice for the PIC to respond properly with the needed data. Any ideas?
Here's the code in question, see any reason why a command would not trigger
the 'kbhit' the first time a serial command...
|
by: issac |
last post by:
Hi folks
Im trying to do a simple query involving the distinct keyword and an
access 2000 db, but have been frittering with it for amost and hour
and a half and I cant make it work.
This is the SQL I would run if it were valid syntax, but it's not:
Select COLOR1, COLOR2, distinct DESC from COLORS;
TABLE COLORS
|
by: M |
last post by:
If I have a query I am writing, I can use the top 10 function to bring
back the top 10 rows. That's all fine if all I want is 10 rows.
What if I have a grouped query, and I have 5 entities that I want 10
rows each from? ie, I have 5 buildings I would want max 50 rows.
I tried Union, which works if you want them all, but I would like the...
|
by: raghuvendra |
last post by:
Hi
I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button.
All these are aligned in a row. And Each Category Name has its corresponding Category order, Input field and a submit button.
The Category name is being fetched from the oracle db along with the corresponding Category order.
In...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
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 we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |