dazzled1
asked on
Can you use an Inline Query in mysql?
Can you use an Inline Query in mysql?
I am not sure if it is even possible and I can't find any documentation on it or make it work...
Hope you can help!!
SELECT c.NAME catname,
t.ID id,
t.title,
u.USERNAME username,
DATE_FORMAT(t.date,'%d/%m/ %Y %h:%i%p') date,
p.p_date
FROM category c,
topics t,
users u,
(SELECT max(date) p_date
, topic_id p_topic_id
FROM post
GROUP BY topic_id) p
WHERE t.cat_id = c.ID
AND t.USERID = u.ID
AND p.p_topic_id = t.id
ORDER BY t.date DESC
Is there an equivalent if you cannot do it this way?
Dave
I am not sure if it is even possible and I can't find any documentation on it or make it work...
Hope you can help!!
SELECT c.NAME catname,
t.ID id,
t.title,
u.USERNAME username,
DATE_FORMAT(t.date,'%d/%m/
p.p_date
FROM category c,
topics t,
users u,
(SELECT max(date) p_date
, topic_id p_topic_id
FROM post
GROUP BY topic_id) p
WHERE t.cat_id = c.ID
AND t.USERID = u.ID
AND p.p_topic_id = t.id
ORDER BY t.date DESC
Is there an equivalent if you cannot do it this way?
Dave
ASKER
I get the following error.
MySQL said:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT max( date ) p_date, topic_id p_topic_id
FROM post
GROUP
This would work in Oracle... Unfortuantely I am not an expert in MYSQL
MySQL said:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT max( date ) p_date, topic_id p_topic_id
FROM post
GROUP
This would work in Oracle... Unfortuantely I am not an expert in MYSQL
ASKER
Right up to 500 points now!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What is the error you are getting...