[Koha] SQL report

Сычев Игорь Алексеевич ias at tpu.ru
Thu Feb 20 22:10:55 NZDT 2025


Hi!

How do I find only four digits at the beginning of a string?
Example, there are values. 
1234
2345
123456
25-1
24-11
VK-2
-123
123*

At the exit, I need to get
1234
2345

regexp '^[0-9]{4}' does not give the desired result.

My test:
SELECT itemnumber, biblionumber, barcode, stocknumber, withdrawn, itemnotes_nonpublic, itype
FROM items
WHERE stocknumber regexp '^[0-9]{4}'
  AND itype = "BK"

Good Luck!

Igor A. Sychev
Tomsk Polytechnic University
https://lib.tpu.ru




More information about the Koha mailing list