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

SQL Distinct

What should be the SQL Query syntax to get the result:
Basicaly it's a dinstinct on "Name" but the DocUNID is always quicking in

Query not working: SELECT DISTINCT sysEnum.Name, sysEnum.docUNID FROM
sysEnum ORDER BY sysEnum.Name ASC;

Desired Results:
{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType
{CC626E01-A3AE-444B-BB89-075DEF192725} Module
{7928EE15-C6B2-4F53-B9C9-7B8BED227574} UserType


Here is the table "sysEnum"
DOCUNID
Name

{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType
{E0F887EA-7573-4D00-9DE2-43D68435F9CB} ListType
{BB83F135-608E-4104-A5A4-2E1D26AEE6DA} ListType
{CC626E01-A3AE-444B-BB89-075DEF192725} Module
{3C6A6B47-1DCE-42CB-8859-66D6BAB479B5} Module
{CF7678C2-39BE-4A7A-9695-48445C99C8FF} Module
{7928EE15-C6B2-4F53-B9C9-7B8BED227574} UserType
{0E3AA5C8-953F-4146-A7EB-92164100C67A} UserType
{942CCCB1-CBCB-4B47-8BA6-EF34CEA1DA03} UserType
{5CA375D8-87ED-4FE3-83B9-4098CC3AB73E} UserType
Thanks for the help
Nicolas
Mar 22 '06 #1
4 1168
"Nicolas" <nl*****@hotmail.com> schrieb
What should be the SQL Query syntax to get the result:
Basicaly it's a dinstinct on "Name" but the DocUNID is always
quicking in

Query not working: SELECT DISTINCT sysEnum.Name, sysEnum.docUNID
FROM sysEnum ORDER BY sysEnum.Name ASC;

Desired Results:
{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType
{CC626E01-A3AE-444B-BB89-075DEF192725} Module
{7928EE15-C6B2-4F53-B9C9-7B8BED227574} UserType


Here is the table "sysEnum"
DOCUNID
Name

{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType
{E0F887EA-7573-4D00-9DE2-43D68435F9CB} ListType
{BB83F135-608E-4104-A5A4-2E1D26AEE6DA} ListType
{CC626E01-A3AE-444B-BB89-075DEF192725} Module
{3C6A6B47-1DCE-42CB-8859-66D6BAB479B5} Module
{CF7678C2-39BE-4A7A-9695-48445C99C8FF} Module
{7928EE15-C6B2-4F53-B9C9-7B8BED227574} UserType
{0E3AA5C8-953F-4146-A7EB-92164100C67A} UserType
{942CCCB1-CBCB-4B47-8BA6-EF34CEA1DA03} UserType
{5CA375D8-87ED-4FE3-83B9-4098CC3AB73E} UserType

Actually this is a SQL question, not a VB.Net question, but...
Why is it

{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType

not

{E0F887EA-7573-4D00-9DE2-43D68435F9CB} ListType

?
Armin
Mar 22 '06 #2
This is an enumrator table so I got one table for the enumator per say and
another table with the enumerator name that is is to be use with custom
globalization for title
This should list the type of enumerator
DocUNID
Name DefaultValue en
fr es
{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType
"ListType" Type of List Type de liste
{CC626E01-A3AE-444B-BB89-075DEF192725} Module
"ModuleList" List of Module Liste de modules
This is the global Table for all enumerator
Then I got the other table for those enum
DocUNID
Name ID DefaultValue en
fr es
{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType 0
Item1
{E0F887EA-7573-4D00-9DE2-43D68435F9CB} ListType 1
Item2
{BB83F135-608E-4104-A5A4-2E1D26AEE6DA} ListType 2
Item2
{CC626E01-A3AE-444B-BB89-075DEF192725} Module 0
Module1
{3C6A6B47-1DCE-42CB-8859-66D6BAB479B5} Module 1
Module2
{CF7678C2-39BE-4A7A-9695-48445C99C8FF} Module 2
Module3

"Armin Zingler" <az*******@freenet.de> wrote in message
news:ur**************@TK2MSFTNGP09.phx.gbl...
"Nicolas" <nl*****@hotmail.com> schrieb
What should be the SQL Query syntax to get the result:
Basicaly it's a dinstinct on "Name" but the DocUNID is always
quicking in

Query not working: SELECT DISTINCT sysEnum.Name, sysEnum.docUNID
FROM sysEnum ORDER BY sysEnum.Name ASC;

Desired Results:
{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType
{CC626E01-A3AE-444B-BB89-075DEF192725} Module
{7928EE15-C6B2-4F53-B9C9-7B8BED227574} UserType


Here is the table "sysEnum"
DOCUNID
Name

{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType
{E0F887EA-7573-4D00-9DE2-43D68435F9CB} ListType
{BB83F135-608E-4104-A5A4-2E1D26AEE6DA} ListType
{CC626E01-A3AE-444B-BB89-075DEF192725} Module
{3C6A6B47-1DCE-42CB-8859-66D6BAB479B5} Module
{CF7678C2-39BE-4A7A-9695-48445C99C8FF} Module
{7928EE15-C6B2-4F53-B9C9-7B8BED227574} UserType
{0E3AA5C8-953F-4146-A7EB-92164100C67A} UserType
{942CCCB1-CBCB-4B47-8BA6-EF34CEA1DA03} UserType
{5CA375D8-87ED-4FE3-83B9-4098CC3AB73E} UserType

Actually this is a SQL question, not a VB.Net question, but...
Why is it

{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType

not

{E0F887EA-7573-4D00-9DE2-43D68435F9CB} ListType

?
Armin

Mar 22 '06 #3
"Nicolas" <nl*****@hotmail.com> schrieb im Newsbeitrag
news:eV**************@TK2MSFTNGP10.phx.gbl...
This is an enumrator table so I got one table for the enumator per say and
another table with the enumerator name that is is to be use with custom
globalization for title
This should list the type of enumerator
DocUNID
Name DefaultValue en
fr es
{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType
"ListType" Type of List Type de liste
{CC626E01-A3AE-444B-BB89-075DEF192725} Module
"ModuleList" List of Module Liste de modules
This is the global Table for all enumerator
Then I got the other table for those enum
DocUNID
Name ID DefaultValue en
fr es
{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType 0
Item1
{E0F887EA-7573-4D00-9DE2-43D68435F9CB} ListType 1
Item2
{BB83F135-608E-4104-A5A4-2E1D26AEE6DA} ListType 2
Item2
{CC626E01-A3AE-444B-BB89-075DEF192725} Module 0
Module1
{3C6A6B47-1DCE-42CB-8859-66D6BAB479B5} Module 1
Module2
{CF7678C2-39BE-4A7A-9695-48445C99C8FF} Module 2
Module3

Sorry, but it's hard for me to recreate the columns from this posting. Also
always use a fixed-width font in newsgroups. What ist the column DocUNID and
what is Name?
Armin

Mar 23 '06 #4
Thanks for try to help, I got the answer from another news group as you
mention SQL newsgroup
Here is the answer:

SELECT Max(CAST(sysEnum.DocUNID AS VARCHAR(50))), SysEnum.Name
FROM sysEnum
GROUP BY SysEnum.Name

Nicolas

"Armin Zingler" <az*******@freenet.de> wrote in message
news:OQ**************@TK2MSFTNGP11.phx.gbl...
"Nicolas" <nl*****@hotmail.com> schrieb im Newsbeitrag
news:eV**************@TK2MSFTNGP10.phx.gbl...
This is an enumrator table so I got one table for the enumator per say and another table with the enumerator name that is is to be use with custom
globalization for title
This should list the type of enumerator
DocUNID
Name DefaultValue en
fr es
{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType
"ListType" Type of List Type de liste {CC626E01-A3AE-444B-BB89-075DEF192725} Module
"ModuleList" List of Module Liste de modules
This is the global Table for all enumerator
Then I got the other table for those enum
DocUNID
Name ID DefaultValue en
fr es
{F77A1DCD-3948-4761-B38F-C5DD0A823196} ListType 0
Item1
{E0F887EA-7573-4D00-9DE2-43D68435F9CB} ListType 1
Item2
{BB83F135-608E-4104-A5A4-2E1D26AEE6DA} ListType 2
Item2
{CC626E01-A3AE-444B-BB89-075DEF192725} Module 0
Module1
{3C6A6B47-1DCE-42CB-8859-66D6BAB479B5} Module 1
Module2
{CF7678C2-39BE-4A7A-9695-48445C99C8FF} Module 2
Module3
Sorry, but it's hard for me to recreate the columns from this posting.

Also always use a fixed-width font in newsgroups. What ist the column DocUNID and what is Name?
Armin

Mar 23 '06 #5

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

Similar topics

3
by: ben | last post by:
This is a PHP / MySQL kind of question. I am making a script which simply pulls information from a database and displays it on screen. BUT there will be entries where fields could be the same, and...
5
by: Martin Feuersteiner | last post by:
Dear Group I'm having trouble with the clause below. I would like to select only records with a distinct TransactionDate but somehow it still lists duplicates. I need to select the...
2
by: mfyahya | last post by:
I have two tables, both containing an 'authors' column. Is there a way to get a unique list of authors from the two tables? I tried SELECT DISTINCT `authors` from `table1`, `table2`; but I got an...
4
by: Johnson, Shaunn | last post by:
Howdy: Can someone tell what the difference (and why you would use it) is between the following: select distinct on (col_1, col_2), col_1, col_2, col_3
18
by: mathilda | last post by:
My boss has been adamant that SELECT DISTINCT is a faster query than SELECT all other factors being equal. I disagree. We are linking an Access front end to a SQL Server back end and normally are...
1
by: nfrodsham | last post by:
In Microsoft's help literature, it states: "You can filter out non-unique rows by using the DISTINCT option of an aggregate function" I am trying to do this in Access 2003 with the COUNT...
3
by: orekinbck | last post by:
Hi There Our test database has duplicate data: COMPANYID COMPANYNAME 1 Grupple Group 2 Grupple Group 5 Grupple Group 3 Yada Inc 4 Yada...
6
by: Bob Stearns | last post by:
I am getting unwanted duplicate rows in my result set, so I added the DISTINCT keyword to my outermost SELECT. My working query then returned the following message: DB2 SQL error: SQLCODE: -214,...
4
by: monomaniac21 | last post by:
hi! is it possible to do the aforementioned query - selecting only distinct in 1 col but retrieving all other cols at the same time. regards marc
2
by: Techhead | last post by:
I need to run a SELECT DISTINCT query across multiple fields, but I need to add another field that is NON-DISTINCT to my record set. Here is my query: SELECT DISTINCT lastname, firstname,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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
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.