I need to retrieve the first record created by a customer, using only a WHERE clause. I cannot use LIMIT, ORDER BY, etc.
SELECT *
FROM mytable
WHERE customer_id = 1
AND created = ? the earliest timestamp for that customer
Edit: In anticipation of those who will ask, it’s a limitation of a specific case in the current framework I’m using. Don’t worry about it. I just have to do it this way. If it can’t be done, just let me know it can’t be done.
Thanks in advance.
Edit2: Thanks everyone but I can’t use any joins either. Any more ideas or can it simply not be done?
1 Answer