Try one of the following:

1) Move the GROUP BY between WHERE and HAVING

-OR-

2)SELECT l.*,lg.* FROM lesson l LEFT JOIN lesson_gle lg ON lg.l_id=l.l_id
WHERE lg.glenum LIKE 'MA%' GROUP BY l.l_id ORDER BY l.l_id

- Jonathan



"Adv. Systems Design" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

I appreciate the input but it does not work...I tried

it before and just now...this is the output:

SELECT *

FROM lesson, lesson_gle

WHERE lesson.l_id = lesson_gle.l_id

HAVING lesson_gle.glenum LIKE 'MA%'

ORDER BY lesson.l_id

GROUP BY lesson.l_id


MySQL Error: You have an error in your SQL syntax near

'GROUP BY lesson.l_id ' at line 7

This script cannot continue, terminating.


Any other ideas?

Luis

> hello:
>
> I have 2 tables...lesson and lesson_gle (which holds
> repeating data for lesson, i.e. l_id, glenum)
>
> the following query gets results, but there are
> repeated entries (one for every repeat in lesson_gle
> table)
>
> SELECT *
> FROM lesson, lesson_gle
> WHERE lesson.l_id = lesson_gle.l_id
> HAVING lesson_gle.glenum LIKE 'MA%'
> ORDER BY lesson.l_id
>
> Any ideas on how to get the data to not repeat?
>
> Thanks
>
> Luis
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to