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 |
|
empyrean
Starting Member
14 Posts |
Posted - 2009-09-30 : 10:32:50
|
| HiI wanted to select the coulumns based on this statement.I have data like ZD0892837d39934.123 D DAVID.PDZD0938383D32484.324 D DAVID.ADZF0844838F32933.234 D DAVID.ADnow i wanted to selet the rows by checking this condition. If second letter in first column(ZD0892837d39934.123) is equal to first letter in second column (D DAVID.PD) then these rows are to be excluded and based on this condition i need to display only third row. |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-09-30 : 10:34:57
|
| SELECT stufffrom tablewhere substring(col1,2,1) <> left(col2,1)JimEveryday I learn something that somebody else already knew |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-30 : 10:39:28
|
| select columns from your_tablewhere substring(col1,2,1) <>left(col2,1)MadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-30 : 10:39:58
|
MadhivananFailing to plan is Planning to fail |
 |
|
|
empyrean
Starting Member
14 Posts |
Posted - 2009-09-30 : 10:46:11
|
| Thank you so much. it worked :) |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-30 : 10:59:46
|
| Another methodselect columns from your_tablewhere col2 not like substring(col1,2,1)+'%'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|