views:

50

answers:

5

I'd like to do this but I know this isn't the right syntax:

INSERT INTO TBL1
SELECT Col1    
FROM TBL2    
WHERE Col1.endswith('s')
+4  A: 
INSERT INTO TBL1
SELECT Col1    
FROM TBL2    
WHERE col1 LIKE '%s'

where % works like * in wildcard and .+ in RegEx. It is SQL Server RegEx pattern indeed.

abatishchev
@wil: I was first :P
abatishchev
Hammen Akhen, here you go
wil
@wil: Thank you! btw, what does it mean, if not a secret? :)
abatishchev
Hammen Akhen? It basically means 'here ya go'
wil
@wil: And what language?
abatishchev
A: 
where substring(col1,LEN(col1)-1,1) = 's'
Jamiec
+2  A: 
INSERT INTO TBL1 
SELECT Col1
FROM TBL2
WHERE Col1 LIKE '%s'
InSane
Thank you very much.
wil
+1  A: 
Insert Into TBL1
select Col1
from TBL2
where Col1 like '%s'
Vinnie
+1  A: 
WHERE col1 like '%s'

% is the wildcard character which takes any value or any number of characters.

This site is good for learning this kind of thing: http://www.w3schools.com/sql/sql_like.asp

Buh Buh