|
View previous topic :: View next topic
|
| Author |
Message |
Mahua Mitra
New User
Joined: 26 Apr 2007 Posts: 49 Location: Delhi
|
|
|
|
Hi
Say I have a query:
Selet A, B, C
from tableA
My req is whatever be the value of A, B and C, the value of must display as 1.
Say in tableA the values are;
A B C
2 d e
3 f g
Once we run the above query, the result set must be:
A B C
1 d e
1 f g
Thanks |
|
| Back to top |
|
 |
murmohk1
Senior Member
.jpg)
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Mahua,
| Quote: |
| My req is whatever be the value of A, B and C, the value of must display as 1. |
What is the reason behind this? I believe IBM has not thought of such kind of 'business requirements'. |
|
| Back to top |
|
 |
Srihari Gonugunta
Active User

Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
Murali,
There will be some instances in which you need to hardcode the values in the query. I have some queries like that in my applications.
Mahua, you can use the following query.
Select '1', B, C
from tableA |
|
| Back to top |
|
 |
murmohk1
Senior Member
.jpg)
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Hari,
| Quote: |
| There will be some instances in which you need to hardcode the values in the query. |
I agree with you. But TS wanted col A value to be displayed as '1' irrespective of actual value. I belive this is not HARDCODING the value. |
|
| Back to top |
|
 |
Srihari Gonugunta
Active User

Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
Ok Murali. In that case, Probably Mahua can use this,
Select '1' AS A, B, C
from tableA;
I am expecting Mahua's response to see what exactly he needs. |
|
| Back to top |
|
 |
Mahua Mitra
New User
Joined: 26 Apr 2007 Posts: 49 Location: Delhi
|
|
|
|
Thanks a lot Srihari,
That was o great help. |
|
| Back to top |
|
 |
Srihari Gonugunta
Active User

Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
You are welcome.  |
|
| Back to top |
|
 |
|
|