D
D
DPS_ninja2019-01-25 09:33:09
SQL
DPS_ninja, 2019-01-25 09:33:09

How to output a specific string format via SELECT?

How to output a specific string format via SELECT? I have a table with data in them there are rows with a certain format example: ABC1DE2FJK3. It would be desirable to receive all records of such format. Tried through LiKE'[AZ][0-9][0-9][AZ] and so on. Did not work. Tell me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-stream, 2019-01-25
@d-stream

It's hard to guess without seeing the code. I don't know if DB like can and what is the syntax.
Judging by a cursory googling, the differences from MSSQL are mainly in the escaping of special characters and tricks with encodings.
So tests:
1. make sure that both requests show the same number:

select count(*) from table 
select count(*) from table where str_field like '%'

2. make sure that there are lines with a test starting with the letter "A" 3. make sure that there are lines with a test starting with any letter I think the chain is clear further? hint is bold

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question