PC Review


Reply
Thread Tools Rate Thread

Distinct for one column

 
 
David
Guest
Posts: n/a
 
      6th Dec 2006
I have a query that results 2 columns of data. The first column is ticket
numbers and the second column is an expression. I want to only display the
rows where the expression column is distinct. Any ideas?

Thanks,

Dave


 
Reply With Quote
 
 
 
 
David
Guest
Posts: n/a
 
      6th Dec 2006
11 Bill
12 Bill
13 Bill
14 Rex
15 Rex
16 John
17 Steve

11 Bill
14 Rex
16 John
17 Steve

or

13 Bill
15 Rex
16 John
17 Steve


"KARL DEWEY" <(E-Mail Removed)> wrote in message
news:4333FB5A-17A5-4F26-959E-(E-Mail Removed)...
> Given the data below which results are you looking for?
> Ticket Expression
> 11 Bill
> 12 Joe
> 13 Joe
> 14 John
> 15 Rex
> 16 Rex
> 17 Rex
> Result-1
> Ticket Expression
> 12 Joe
> 13 Joe
> 15 Rex
> 16 Rex
> 17 Rex
> Result-2
> Ticket Expression
> 11 Bill
> 14 John
>
>
> "David" wrote:
>
>> I have a query that results 2 columns of data. The first column is
>> ticket
>> numbers and the second column is an expression. I want to only display
>> the
>> rows where the expression column is distinct. Any ideas?
>>
>> Thanks,
>>
>> Dave
>>
>>
>>



 
Reply With Quote
 
David
Guest
Posts: n/a
 
      7th Dec 2006
I'm sorry I didn't make my last response clear. My boss was flipping out
yesterday.

data in table:
11 Bill
12 Bill
13 Bill
14 Rex
15 Rex
16 John
17 Steve

acceptable output:
11 Bill
14 Rex
16 John
17 Steve

or
acceptable output:
13 Bill
15 Rex
16 John
17 Steve

I basically don't want to display any duplicates in the driver field.

"David" <(E-Mail Removed)> wrote in message
news:uwn%23e$(E-Mail Removed)...
> 11 Bill
> 12 Bill
> 13 Bill
> 14 Rex
> 15 Rex
> 16 John
> 17 Steve
>
> 11 Bill
> 14 Rex
> 16 John
> 17 Steve
>
> or
>
> 13 Bill
> 15 Rex
> 16 John
> 17 Steve
>
>
> "KARL DEWEY" <(E-Mail Removed)> wrote in message
> news:4333FB5A-17A5-4F26-959E-(E-Mail Removed)...
>> Given the data below which results are you looking for?
>> Ticket Expression
>> 11 Bill
>> 12 Joe
>> 13 Joe
>> 14 John
>> 15 Rex
>> 16 Rex
>> 17 Rex
>> Result-1
>> Ticket Expression
>> 12 Joe
>> 13 Joe
>> 15 Rex
>> 16 Rex
>> 17 Rex
>> Result-2
>> Ticket Expression
>> 11 Bill
>> 14 John
>>
>>
>> "David" wrote:
>>
>>> I have a query that results 2 columns of data. The first column is
>>> ticket
>>> numbers and the second column is an expression. I want to only display
>>> the
>>> rows where the expression column is distinct. Any ideas?
>>>
>>> Thanks,
>>>
>>> Dave
>>>
>>>
>>>

>
>



 
Reply With Quote
 
David
Guest
Posts: n/a
 
      8th Dec 2006
Thanks Karl that worked!

I couldn't get it working properly modify the sql code (im a sql coding
newb). I understood what your code was doing and I went to the builder and
first on the tickets column and then group by on the expression column.
Worked like charm. Thanks again!

"KARL DEWEY" <(E-Mail Removed)> wrote in message
news:4AF8342F-CF28-4026-8133-(E-Mail Removed)...
> See my post yesterday afternoon with SQL for both methods.
>
> "David" wrote:
>
>> I'm sorry I didn't make my last response clear. My boss was flipping out
>> yesterday.
>>
>> data in table:
>> 11 Bill
>> 12 Bill
>> 13 Bill
>> 14 Rex
>> 15 Rex
>> 16 John
>> 17 Steve
>>
>> acceptable output:
>> 11 Bill
>> 14 Rex
>> 16 John
>> 17 Steve
>>
>> or
>> acceptable output:
>> 13 Bill
>> 15 Rex
>> 16 John
>> 17 Steve
>>
>> I basically don't want to display any duplicates in the driver field.
>>
>> "David" <(E-Mail Removed)> wrote in message
>> news:uwn%23e$(E-Mail Removed)...
>> > 11 Bill
>> > 12 Bill
>> > 13 Bill
>> > 14 Rex
>> > 15 Rex
>> > 16 John
>> > 17 Steve
>> >
>> > 11 Bill
>> > 14 Rex
>> > 16 John
>> > 17 Steve
>> >
>> > or
>> >
>> > 13 Bill
>> > 15 Rex
>> > 16 John
>> > 17 Steve
>> >
>> >
>> > "KARL DEWEY" <(E-Mail Removed)> wrote in message
>> > news:4333FB5A-17A5-4F26-959E-(E-Mail Removed)...
>> >> Given the data below which results are you looking for?
>> >> Ticket Expression
>> >> 11 Bill
>> >> 12 Joe
>> >> 13 Joe
>> >> 14 John
>> >> 15 Rex
>> >> 16 Rex
>> >> 17 Rex
>> >> Result-1
>> >> Ticket Expression
>> >> 12 Joe
>> >> 13 Joe
>> >> 15 Rex
>> >> 16 Rex
>> >> 17 Rex
>> >> Result-2
>> >> Ticket Expression
>> >> 11 Bill
>> >> 14 John
>> >>
>> >>
>> >> "David" wrote:
>> >>
>> >>> I have a query that results 2 columns of data. The first column is
>> >>> ticket
>> >>> numbers and the second column is an expression. I want to only
>> >>> display
>> >>> the
>> >>> rows where the expression column is distinct. Any ideas?
>> >>>
>> >>> Thanks,
>> >>>
>> >>> Dave
>> >>>
>> >>>
>> >>>
>> >
>> >

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get the distinct values in a column & put it in next col VIDYA Microsoft Excel Misc 2 22nd Dec 2008 06:28 PM
scroll records with distinct value in column sal21 Microsoft Excel Programming 0 29th Jan 2008 10:17 PM
select distinct and another column... tony c Microsoft Access Queries 2 30th Jan 2007 02:32 PM
distinct values in column parthaemail Microsoft Excel New Users 13 13th Mar 2006 02:40 PM
Get distinct values from a column in a datatable jvb Microsoft VB .NET 2 30th Jan 2006 08:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:00 PM.