patindex Questions

21

Solved

I've got dirty data in a column with variable alpha length. I just want to strip out anything that is not 0-9. I do not want to run a function or proc. I have a script that is similar that just g...
Weirdo asked 4/9, 2013 at 23:41

3

Solved

I am in need of Postgres equivalent of the SQL function patindex
Stogy asked 11/5, 2017 at 11:51

1

I'm writing different queries in SQL Server. I have 2 tables, Employees and Departments. Table Employees consists of EMPLOYEE_ID, ENAME, ID_DEP - department id. Table Departments consists of ID_DEP...
Galloglass asked 30/12, 2021 at 16:54

2

Solved

I have come across this line in an old report that needs converting to SQL Server. REGEXP_LIKE (examCodes, learner_code) examCodes being the source and learner_code being the pattern. I know th...
Bifoliate asked 1/5, 2013 at 9:22

4

Solved

CREATE TABLE #tmpTbl (m VARCHAR(100)) INSERT INTO #tmpTbl VALUES (',[Undergraduate1]') ,(',[Undergraduate10]') ,(',[Undergraduate11]') ; GO select LEFT(m, PATINDEX('%[0-9]%', m)-1) as a, SUB...
Agist asked 30/5, 2016 at 1:36

0

In the below code example, all results should return 7. Those with aliases beginning X however, do not. select --where matches patindex('%-%' ,'111111-11') dash --not a special character, so wo...
Averroes asked 3/3, 2016 at 18:3

2

Solved

I need to check the library used by several stored procs that extract data from a remote server. I have (with SO help, see SO 21708681) built the below code: DECLARE @tProcs TABLE ( procID int ...
Statuesque asked 12/2, 2014 at 9:59
1

© 2022 - 2025 — McMap. All rights reserved.