If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > delete from certain point.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-30-04, 13:57
estefex estefex is offline
Registered User
 
Join Date: Jan 2004
Posts: 159
delete from certain point.

How would I be able to delete everything after the "/" from a sample column listed below. Everything from the "/" and after in not suppose to be in the column.


Column A

A32916/917
A33649/650
DUPONT2/10/0
A37154/37152
A37154/37152
A35419/35422
Reply With Quote
  #2 (permalink)  
Old 04-30-04, 14:52
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
String handling functions in SQL are pretty engine specific. Since you regularly post in the MS-SQL forum, I'll assume that is what you plan to use, so I'd suggest:
Code:
SELECT Left([Column A], CharIndex([Column A], '/') - 1)
   WHERE [Column A] LIKE '%/%'
-PatP
Reply With Quote
  #3 (permalink)  
Old 05-02-04, 17:36
Nocopy Nocopy is offline
Registered User
 
Join Date: May 2004
Location: Redwood Shores, CA
Posts: 68
Oracle sql

If I did it in Oracle I would have used UPDATE instead of SELECT.

Now in SQL server it may be different.
Reply With Quote
  #4 (permalink)  
Old 05-02-04, 18:24
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
LOL

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 05-02-04, 19:17
Nocopy Nocopy is offline
Registered User
 
Join Date: May 2004
Location: Redwood Shores, CA
Posts: 68
r937
Glad you liked it.
I looked at your rudy.
You the Shit.
Reply With Quote
  #6 (permalink)  
Old 05-02-04, 19:20
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
thank you

nicest compliment i've had all week

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On