MySQL Forums
Forum List  »  Newbie

Re: Creating table from already existing table
Posted by: Rick James
Date: May 02, 2015 07:18AM

And  cast(ex_date AS DATE) in (
            SELECT  max(cast(ex_date AS DATE))
                From  a_vets.vt_exam_headers
                   )
That limits the query to only the exams on that one day. Were there 2 exams that day?

> cast(ex_date AS DATE)
What datatype is ex_date? If it is already a DATE, then the CAST is unnecessary.

What table is cl_id in? (Qualify fields to make that clear.)

Check the arithmetic; GROUP BY on a JOIN sometimes inflates the numbers.

Options: ReplyQuote


Subject
Written By
Posted
Re: Creating table from already existing table
May 02, 2015 07:18AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.