View previous topic :: View next topic
|
Author |
Message |
sakthivel_t100 Warnings : 1 New User
Joined: 03 Aug 2007 Posts: 10 Location: chennai
|
|
|
|
Hi ALL,
I have one query. could you please answer for below query?
I have a emp table which column has value India Pakistan. I want result like IndiaPakistan. It should not be space between India and Pakistan. I need a query without using concentation fuction on DB2.
Thanks |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
That requires a political and cultural answer. DB2 is only logical. |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
So is the value in the column "India Pakistan" or are there 2 columns with values "India" and "Pakistan". And what is the reason for not using the concatenation function? It is there to be used. |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
If it is 2 columns then
Code: |
SELECT COLUMN A || COLUMN B
FROM empTable
|
It isn't use the concatenate function directly... |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
dbzTHEdinosauer: Shouldn't Kashmir be wedged between them?
IndiaKasmirPakistan? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Steve, from what I understand, that is part of the problem. India thinks Kashmir is part of India and Pakistan also claims Kashmir as a province.
I think the OP has only one column. Judicious use of substring would probably solve the problem, but having concatenation ruled out, I don't really believe this was a query about programming. |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
Without substring, isn't there a replace function that would kill all the spaces? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Received two (2) PM's from sakthivel_t100.
He feels that I am trying to start trouble.
Well, first the restriction on the common sense use of the concatenation function.
Then, in his example he used the names of two nations that have political & cultural disagreements.
ok, i read too much into the question; not trying to start trouble. there is plenty of it around.
sakthivel_t100, don't send me any more of PM's.
Not please don't, just don't! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please explain the business reason for this "rule"
Quote: |
I need a query without using concentation fuction on DB2. |
If there is no business requirement for this, you might let us know that it is something from school/training, an interview, or just an experiment that you are trying. |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
Yeah I got a PM too. Oh well, it wasn't meant to be anything. |
|
Back to top |
|
|
|