C_Pietro
C_Pietro

Reputation: 61

Can I use SQL to edit a piece of a record in a group of rows?

The records of one column in my table have a letter/dash prefix (B-290151626). I need to remove the letter/dash without changing the rest of the record, and do this for 1700 rows.

This is for the Paradox database (yes I know it's old) and I have a simple SQL editor window to work with inside the application. I can select all the records I need to edit, grouped by their letter prefix.

Here's a view of the table: View of table

Upvotes: 1

Views: 153

Answers (1)

China Syndrome
China Syndrome

Reputation: 993

UPDATE table 
SET BookingID = SUBSTRING(BookingID , 3, LEN(BookingID ) - 2) 
where  substring(BookingID,0,1) ='B' 

Upvotes: 0

Related Questions