473,587 Members | 2,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting Distinct Values From A Single Row

45 New Member
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
Expand|Select|Wrap|Line Numbers
  1. SELECT MEMBER.ACCT, MEMBER.NACD, MEMBER.FRST, MEMBER.ID, MEMBER.LAST, MEMBER.MID, ORDER.BAL, ORDER.TYPE, ORDER.TINUM
  2. FROM MEMBER INNER JOIN ORDER ON MEMBER.ACCT = ORDER.SHACCT
  3. 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
Mar 15 '10 #1
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.
Mar 16 '10 #2
toadmaster
45 New Member
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??
Mar 16 '10 #3
hedges98
109 New Member
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...
Mar 16 '10 #4
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.
Mar 16 '10 #5
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.
Mar 16 '10 #6
hedges98
109 New Member
Remember, many of our members are very inexperienced at this level. Most progress over time.
helloooooooo!
*waves*
Mar 16 '10 #7
NeoPa
32,566 Recognized Expert Moderator MVP
And you're a perfect example of course :D
Mar 16 '10 #8
toadmaster
45 New Member
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
Mar 16 '10 #9
hedges98
109 New Member
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?
Mar 16 '10 #10

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

Similar topics

303
17539
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...
1
3385
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>
7
4084
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...
4
5988
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...
6
131117
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
2
8646
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...
36
3185
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...
6
4327
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
2
9246
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...
1
4912
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...
0
8206
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, 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. ...
0
8340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
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 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...
0
6621
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5713
isladogs
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...
0
5392
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...
0
3840
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...
1
2353
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
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.