I've noticed there's been a lot of questions on the select distinct statement,
and in many tries, I can't figure out how to use this correctly in my scenario.
I currently have 2 DBs - one that lists products and one that lists all items
that have been signed out (or in) at any time. This is for inventory purposes.
I am trying to create an HTML table that lists each of the items only once
with the last time they've been signed out/in or blank if they've never been.
My code currently is
SELECT DISTINCT EQUIPMNT.SERIALNUM, EQUIPMNT.NAME SIGNOUT.STATUS, SIGNOUT.RACFID,
SIGNOUT.DATEOUT, SIGNOUT.DATEIN, FROM WEBSRV.SIGNOUT RIGHT JOIN WEBSRV.EQUIPMNT
ORDER BY SIGNOUT.DATEOUT DESC
This code still lists items that have been signed out/in more than once,
multiple times. I've tried using sub-queries, but I'm not quite sure of
the exact syntax to make this work correctly.
Hopefully this is enough information. Thanks to anyone who can help!
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center