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 |
|
suarezst1984
Starting Member
16 Posts |
Posted - 2010-03-15 : 15:08:22
|
| I have to two types of urls on a database one has the following formatwww.google.com/p/partnumberthe other onewww.google.com/p/number_partnumber_characteri want to delete only the first time of url from the databasebut i dont know how to write that delete statement so i dont delete the second type of url tooThanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
suarezst1984
Starting Member
16 Posts |
Posted - 2010-03-15 : 15:19:33
|
| the partnumber changes i forgot to mention that |
 |
|
|
suarezst1984
Starting Member
16 Posts |
Posted - 2010-03-15 : 15:20:21
|
| and also the number and character from the second url |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
suarezst1984
Starting Member
16 Posts |
Posted - 2010-03-15 : 15:26:43
|
| ok I have 2 types or urls in a database.One of them has the following structure www.mydomain.com/cellular/p/89898and the other onewww.mydomain.com/cellular/p/bl_89898_23(This are only examples since 89898 can be any number, and bl could be any combination of letters and 23 could also be any combination of two digits. But basically this is how my urls look. As you can see they are the same until you hit the /p/ after that they change. I want to be able to delete from the database the first type of urls www.mydomain.com/cellular/p/89898 and keep the scond type |
 |
|
|
suarezst1984
Starting Member
16 Posts |
Posted - 2010-03-15 : 15:28:21
|
| I tried stuff like delete from table_number where url like '%www.mydomain.com/cellular/p/%' and url not like '%_%' BUT it did not work |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-03-16 : 03:01:07
|
| If the following gives the urls that should be deleted,select url from your_tablewhere url like 'www.%/p/[0-9]%'change it to deletedelete from your_tablewhere url like 'www.%/p/[0-9]%'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|