Add column with fixed number of values (text) to the select statement
Hello,
I have such a problem. Need to add additional column to my query. The column should consist of set of fixed number (same as number of query rows) values (text). At start thought it's simple but now Im lost. Is there any chance to do it. Apreciate any help. I need to tell that I have only access to select on this database so no use of operation on tables.
[503 byte] By [
Suzej] at [2008-1-7]
I found on the net something to start with
SELECT *, CAST( 0 AS INT) AS newint FROM sample
but it just add a column with value 0 to the set of results.
I'm using ver. 2005. The select is very simple concerns the tables with historical rates for curves.
So there are four columns:
1) Date
2) Name of the curve
3) DF
4) Implied rate
there are 17 rows of data
and I need to add column with fixed tenors
O/N
T/N
S/N
1W
2W
1M
2M
3M
4M
5M
6M
7M
8M
9M
10M
11M
1Y
Your questions not clear properly. But I think this will help you,
USE PUBS
Go
SELECT COUNT(*) row_num, A.au_lname
FROM authors A, authors B
WHERE A.au_lname > B.au_lname
GROUP BY A.au_lname
ORDER BY COUNT(*)
I want results to look like this:
Tenor / Date / Name of the curve/ DF / Implied rate
O/N 1/08/07 EUR_CURVE 0.9999987 4.020000
T/N 1/08/07 EUR_CURVE . .
S/N 1/08/07 EUR_CURVE . .
1W 1/08/07 EUR_CURVE . .
2W 1/08/07 EUR_CURVE . .
1M 1/08/07 EUR_CURVE . .
.
.
.
1Y 1/08/07 EUR_CURVE . .
tks