Find a sub list in list
Assuming that there are several rows of records in the database, the newLISP MySQL module returns the result is a list representing this number of rows of records, and then each element is a list, which contains a row of records, each row of records list contains a number of lists, Each list has two elements: a field name and a field value.
Now we can use the Find method to find patterns.
> (List (List "issue_id" 1773) ' (("issue_id" 1773) ("custom_field_id" 7) ("Type" "Issuecustomfield") ("name" "\229\143\145\231\142\176\230\151\165\230\156\159") ("Default_value" "" ") (" Value "" 2014-06-27 "))) match) 0
This example is to find the first row in the row named issued_id, with a value of 1773, because it uses find, so look for the first row.
Find returns 0, with $ A to view the results.
> ("issue_id" ("1773") ("custom_field_id" 7) ("Type" "Issuecustomfield") ("name" "Discovery Date") ("Default_value" "") ("value") "2014-06-27"))
Find several sub-lists in list
Use Find-all to find all records that match the pattern,
(Set ' R (Find-all (list "issue_id" Issue-id) issue-customized-values))
Similar to find, just notice that the results are returned directly. So don't look at the results with $ A.
However, $count can see how many records were found.
Find/find-all match is ideal for further lookups of database result recordsets
Find list elements with Find/find-all match method