I wrote a query to report credit-cards that were due to expire in the year 2016. It runs, but I do receive a warning, and I'd like to know more about why. I assume it's because of the subquery.
WARNING: Incorrect data value: '2016%' for column 'exp_date' at row 1
I only have one value that meets the requirement of 2016, but is the warning appearing because of possible future values that may meet the same condition?
SELECT customer_id as 'Customer'
FROM customers
WHERE credit_card_id = (
SELECT credit_card_id
FROM credit_cards
WHERE exp_date LIKE '2016%'
LIMIT 1
);
Credit-Card values:
INSERT INTO credit_cards VALUES
(1, '0025184796520000', '2016-08-13', 'Sarah', 'Jones', 3351, '2490 Paseo Verde parkway, suite 150', 'San Diego','CA',92124),
(2, '7896541232548526', '2017-09-21', 'Desmond', 'Lowell', 1204, '3201 Kelsey Street, suite 109', 'San Diego','CA',92174),
(3, '1234567890123456', '2018-02-11', 'Mark', 'Jefferson', 1591, '876 Silverado Street, suite 304', 'Henderson','NV',89162),
(4, '4001330852539605', '2017-01-10', 'Jaime', 'Evans', 8879, '924 Shady Pines Circle, suite 120', 'Summerlin','NV',89074);