Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - query help
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

query help

 Post Reply Post Reply
Author
xdotnet View Drop Down
Newbie
Newbie


Joined: 20 December 2002
Location: Canada
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote xdotnet Quote  Post ReplyReply Direct Link To This Post Topic: query help
    Posted: 27 March 2003 at 11:46am
Hi,

I need some help with this query,
i'm try to get the max(table3_dateEntered) and is table3_name from TABLE3
from select distinct table1_id, table1_name from TABLE1:


TABLE1
table1_id [pk]
table1_name

TABLE2
table2_id [pk]
table1_id [fk]

TABLE3
table3_id [pk]
table3_dateEntered
table3_name
table2_id [fk]



SELECT
t1.table1_id, t1.table1_name, t3.table3_name, max(t3.table3_dateEntered)
FROM
(select distinct table1_id from TABLE1), TABLE3 t3, TABLE2 t2, TABLE1 t1
WHERE
t2.table1_id = t1.table1_id
AND
t3.table2_id= t2.table2_id
GROUP BY
t1.table1_id, t1.table1_name, t3.table3_name


My query display my data but not for distinct table1_id. The problem come from
t3.table3_name, if i remove it from my query, i get my distinct table1_id

Any idea how can this be work ?

thanks.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.