[Koha] SQL report

LibraryITSolutions info at libraryitsolutions.com
Fri Feb 21 00:18:43 NZDT 2025


Hey Igor,

Try this:

SELECT itemnumber, biblionumber, barcode, stocknumber, withdrawn, itemnotes_nonpublic, itype
FROM items
WHERE stocknumber REGEXP '^[0-9]{4}$'
AND itype = "BK";

Beste Grüße,
Eugen Bastron

> Am 20.02.2025 um 10:11 schrieb Сычев Игорь Алексеевич <ias at tpu.ru>:
> 
> 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
> 
> 
> _______________________________________________
> 
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha



More information about the Koha mailing list