Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
samsun125
Yak Posting Veteran
63 Posts |
Posted - 2008-12-04 : 02:07:16
|
| Hi all,MY problem is in my table i have 3 columns table name:tblsessioncolumns:sessionid(int), timestamp(datetime),tokenkey(guid)(varchar)values:23,2008-12-04 12:40:37.640,BE97C028-31A1-4258-BE3B-C53B1E3D99D7i want to return concatenation format of sessionid and that session id tokenkey for this i am using this query:SELECT max(convert(varchar,sessionid))+ ' ' + MAX (TokenKey) FROM tblsessionbut is is returning always 9 value instead of 23.....Thanks and RegardsRamaDevi |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-04 : 02:14:29
|
may be this:-SELECT convert(varchar(5),max(sessionid))+ ' ' + MAX (TokenKey) FROM tblsession |
 |
|
|
samsun125
Yak Posting Veteran
63 Posts |
Posted - 2008-12-04 : 02:29:10
|
| the above returns maxsessionid but tokenkey is someothertokenkey but i want that sessionid tokenkey onlyIF I am using this query means i am getting all the values of the tblsessionSELECT convert(varchar(50),sessionid)+ ' ' + TokenKey FROM tblsessionBut what i am trying to do is i want to return max sessionid along with that tokenkey ex:max sessionid=23 that sessionid (23) tokenkey is 'ertwrpeojpo' i want to return 23 ertwrpeojpo like this Thanks & RegardsRamaDevi |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-04 : 02:55:11
|
| [code]SELECT convert(varchar(5),sessionid)+ ' ' + TokenKey FROM tblsession WHERE sessionid=(SELECT MAX(sessionid) FROM tblsession)[/code] |
 |
|
|
|
|
|