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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Selecting Rows beginning with Specific Characters

Author  Topic 

Nadam
Starting Member

1 Post

Posted - 2010-02-05 : 13:48:23
Is there a command that allows me to select individual rows that begin with specific characters?
For example, if i had the following table:

Product Description Sales
10-001 Product 1-A 100
00-001 Product 0-A 50
00-002 Product 0-B 200
00-003 Product 0-C 75
10-002 Product 1-B 25
10-003 Product 1-C 150

What would be the command to select only the products that begin with "00-". Another way of thinking about this question would be, how do i delete the rows that begin with "10-"

Again, thanks in advance!
-N

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-05 : 13:52:02
select columns.. from table where Product like '00-%'

for delete use

delete from table where Product like '10-%'
Go to Top of Page
   

- Advertisement -