|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
sample query for concatenating two strings and using it as column
hi,
please check this query and reply back with the appropriate solution. len(ltrim(rtrim(exec('select' ' ' + 'pay' +convert(substring(@y1,3,2), varchar 2)))))<>0 here the concept is concatenating two string then that result is used as column and retreiveing data.but this is considering it as string instead of column. can anyone give an appropriate solution. Regards, Uma. |
|
#2
|
|||
|
|||
|
i m not sure, just guessing here, say the colum name is firstName
select firstName as concat(select+pay) from...... i dunno, |
|
#3
|
|||
|
|||
|
sample query for concatenating two strings and using it as column
thanks for the reply but let me be clear with my query. the query is as follows:
actually i need to get the records of a particular table from year 1982 to 2003 that is assigned to be pay. so instead of querying for each year i want that to be done in a single query using while hence i quered as i mentioned before. Regards, Uma. |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > sample query for concatenating two strings and using it as column |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|