View Single Post
Old 10-20-2017, 09:56 AM   #228
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Tanjamuse:

You are using the SQL Query Tab. The "9" in that Custom Column table number has nothing whatsoever to do with anything else. It is a coincidence that the Regular Expression Tab regular expression that you used in the Full Text Query Tab was a "9".

See the attached picture of the ToolTips for my SQL Query Tab. The numbers on the left are the Custom Column table numbers. They are Calibre-Library specific. Your numbers will be different than mine, and even different among your own Libraries (unless they are copies of each other).

The SQL Query Tab can use regular expressions, but only as part of the SQL that you write. The "example SQL" button in that Tab has a lot of examples, including one with the REGEXP operator (I wrote just for MCS, by the way; it is not standard SQL that comes with Calibre).

Code:
/*Comments: An example that finds ISBNs within Tags:  SELECT book FROM _mcs_tags_by_book WHERE tagname LIKE '%978%' OR tagname LIKE '%045%' OR tagname LIKE '%isbn%' OR tagname REGEXP '^[0-9][-]*[0-9][-]*[0-9][-]*[0-9][-]*[0-9][-]*[0-9][-]*[0-9][-]*[0-9][-]*[0-9][-]*[0-9]+$'*/

Again, the SQL Query Tab does not use any of the Regular Expression Tab's regular expressions. Those regular expressions are used only by the Intra/Inter Book Query Tab and the Full-Text Query Tab.



DaltonST
Attached Thumbnails
Click image for larger version

Name:	mcs_sql_query_tooltips_list_of_custom_columns.jpg
Views:	350
Size:	216.1 KB
ID:	159569  
DaltonST is offline   Reply With Quote