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 |
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2008-09-11 : 10:49:44
|
| How to get all the rows which has the extension pdf end the end of filepath.filepath is the field it has the filepath stored in it: name: 'D:\ProjectImages\HRT\RM\projectFileName.pdf'*****************************select docid, filepath from table_files where filepath extension has .pdf.**************************Thank you very much for the information. |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2008-09-11 : 10:51:56
|
| select docid, filepath from table_files where right(filepath,4) = '.pdf'Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881 |
 |
|
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2008-09-11 : 10:53:09
|
| Thks a lot. |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2008-09-11 : 19:04:13
|
| I'm not sure if applying the RIGHT function is any slower than a LIKE comparison, but you could also try:select docid, filepath from table_files where filepath LIKE '%.pdf' |
 |
|
|
|
|
|