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 |
sks198117
Starting Member
46 Posts |
Posted - 2006-08-24 : 11:16:51
|
I have a table with following data col name refNorefNo---ABC-0ABC-1XYZ-0XYZ-1XYZ-2PQR-0MNO-0MNO-1SPX-0SPX-1i want the result as below ABC-1 XYZ-2 PQR-0 MNO-1 SPX-1 |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-08-24 : 11:19:06
|
select max(refNo)from tblgroup by left(refNo,3)==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
sks198117
Starting Member
46 Posts |
Posted - 2006-08-24 : 11:21:47
|
How can i use max with char?quote: Originally posted by nr select max(refNo)from tblgroup by left(refNo,3)==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy.
|
 |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-08-24 : 11:23:35
|
by coding it?not sure what that question is.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
KenW
Constraint Violating Yak Guru
391 Posts |
Posted - 2006-08-24 : 13:22:10
|
sks198117,quote: How can i use max with char?
Because it works with char? <g> Really, it does - it uses the ASCII values of each character to "score" it.Ken |
 |
|
|
|
|