|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Use of 'DISTINCT' keyword |
« View previous topic :: View next topic » |
Author |
Message
|
javaforvivek |
Posted: Fri Aug 13, 2004 5:03 am Post subject: Use of 'DISTINCT' keyword |
|
|
 Master
Joined: 14 Jun 2002 Posts: 282 Location: Pune,India
|
Hi,
WBIMB5 + CSD3
I want to know whether anybody has used 'DISTINCT' keyword.
The ESQL documentation says that it does not support SELECT DISTINCT clause as in normal SQL, nor it specifies what's the use of 'DISTINCT' keyword.
I have an XML Message like this:
<File>
<Line>
<DocNumber>1</DocNumber>
---some more details
</Line>
<Line>
<DocNumber>1</DocNumber>
---some more details
</Line>
<Line>
<DocNumber>2</DocNumber>
---some more details
</Line>
</File>
AS we can see, that document number 1 is repeated in two <Line> tags.
What I want to do is, get the Distinct Document Numbers from the message, i.e. my select statement should give me 1 and 2 rather than 1,1 and 2.
Whether we can write such Select statement or not?
I know that I can write some turn-around code, like storing document numbers in Environment.variable.temp[] and then removing the duplicate entries. _________________ Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 13, 2004 5:29 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If the documentation says that DISTINCT is not supported, then DISTINCT is not supported and you will have to do something else.
It's a shame that there isn't an ORDER BY either. That would make it a little easier. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
PGoodhart |
Posted: Fri Aug 13, 2004 6:26 am Post subject: |
|
|
Master
Joined: 17 Jun 2004 Posts: 278 Location: Harrisburg PA
|
This strikes me as the sort of thing that someone ought to raise as a formal requirement through IBM...
I agree that the distinct keyword and order by clause are very useful and I can't think of a good reason not to allow them? Is it because these are extensions to standard SQL and they are the same on all the database platforms? _________________ Patrick Goodhart
MQ Admin/Web Developer/Consultant
WebSphere Application Server Admin |
|
Back to top |
|
 |
javaforvivek |
Posted: Fri Aug 13, 2004 8:37 am Post subject: |
|
|
 Master
Joined: 14 Jun 2002 Posts: 282 Location: Pune,India
|
I agree with both of you, but then I wonder what is the use of DISTINCT keyword??
Or it's just kept as a Reserved keyword for the future releases when the Distinct functionality will be implemented in ESQL... _________________ Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth. |
|
Back to top |
|
 |
martinrydman |
Posted: Fri Aug 13, 2004 10:17 am Post subject: |
|
|
 Centurion
Joined: 30 Jan 2004 Posts: 139 Location: Gothenburg, Sweden
|
Hi,
I'd only like to point out that, as long as you're accessing a datbase, you can use the PASSTHRU command, which allows you to use the full range of SQL supported by the target database. If you're using ESQL to access message trees, then you're stuck with what ESQL has to offer.
/Martin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|