Help with query result MIN or LIMIT

Help with query result MIN or LIMIT

Nosūtīja Plínio Felipe Peçanha Oliveira
Atbilžu skaits: 2
Hi, I appreciate any help.

I'm creating a more complex query and this would be a fragment of the other one.


SELECT
DATE_FORMAT(FROM_UNIXTIME(timecreated),'%d-%m-%Y') AS 'Nível:'

FROM prefix_logstore_standard_log
WHERE eventname LIKE '%course_viewed%'
#USERID
AND userid=20765
ORDER BY timecreated ASC

Turns out I'm not getting it right so that this query returns only the first result of "course_viewed", it's still returning several rows and I just need to display the first register.

If anyone can help, thank you in advance.
Vidējais novērtējums:Useful (1)
Atbildot uz Plínio Felipe Peçanha Oliveira

Re: Help with query result MIN or LIMIT

Nosūtīja Thomas Stanley-Jones

I'm thinking you are just missing the last line,

LIMIT 1