I'm using a LIKE operator in my Query
@Query("SELECT * FROM item where barcodes LIKE :barcode")
List<Item> getItemWithBarcode(String barcode);
Is there any way that i can append something(appendedTxt
) to the bar code? Like this
@Query("SELECT * FROM item where barcodes LIKE (:barcode + 'appendedTxt')")
List<Item> getItemWithBarcode(String barcode);
The || operator is "concatenate" - it joins together the two strings of its operands. Docs
@Query("SELECT * FROM item where barcodes LIKE (:barcode || 'appendedTxt')")
List<Item> getItemWithBarcode(String barcode);
edit: changed double quotes to single
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With