Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 4 of 4 total |
SQL MAX |
Wed, Apr 22 2009 4:44 AM | Permanent Link |
"Paul Coshott" | Hi All,
I have an SQL statement in ElevateDB that uses MAX and a sub select. How can I do the following in DBISAM ? SELECT *, (SELECT MAX(ContactDate) FROM D2DContacts WHERE PatientID = C.PatientID) AS LastContact FROM Patients C Thanks, Paul |
Wed, Apr 22 2009 5:36 AM | Permanent Link |
Fernando Dias Team Elevate | Paul,
Here is what you need: SELECT C.*, MAX(P.ContactDate) AS LastContact FROM Patients C LEFT OUTER JOIN D2DContacts D ON D.PatientID = C.PatientID GROUP BY PatientID -- Fernando Dias [Team Elevate] |
Wed, Apr 22 2009 7:28 PM | Permanent Link |
"Paul Coshott" | Hi Fernando,
thanks very much for the help. Cheers, Paul "Fernando Dias" <fernandodias.removthis@easygate.com.pt> wrote in message news:825BFA88-11EF-4565-B2A9-06621997722C@news.elevatesoft.com... > Paul, > > Here is what you need: > > SELECT > C.*, MAX(P.ContactDate) AS LastContact > FROM > Patients C > LEFT OUTER JOIN D2DContacts D ON D.PatientID = C.PatientID > GROUP BY > PatientID > > -- > Fernando Dias > [Team Elevate] > |
Wed, Apr 29 2009 2:31 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Paul,
<< I have an SQL statement in ElevateDB that uses MAX and a sub select. How can I do the following in DBISAM ? >> I knew it would happen eventually, but I think that's the first of that type of question (EDB --> DBISAM). -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, May 7, 2024 at 06:25 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |