Re: [sqlite] Problems with max(datestamp) in subquery

2009-08-17 Thread David Bicking
On Mon, 2009-08-17 at 15:05 -0700, Leo Freitag wrote: > David Bicking-2 wrote: > > > > As written, you were selecting any record with the correct date > > regardless of Ensemble or Steuck. > > > > David > The following seem to work: > > SELECT * FROM tblZO_Haupt AS hpt > WHERE >

Re: [sqlite] Problems with max(datestamp) in subquery

2009-08-17 Thread Leo Freitag
David Bicking-2 wrote: > > As written, you were selecting any record with the correct date > regardless of Ensemble or Steuck. > > David > The following seem to work: SELECT * FROM tblZO_Haupt AS hpt WHERE hpt.zo_tblEnsemble = AND hpt.zo_tblStueck = ... AND hpt.datum = ( SELECT

Re: [sqlite] Problems with max(datestamp) in subquery

2009-08-12 Thread David Bicking
On Wed, 2009-08-12 at 07:02 -0700, Leo Freitag wrote: > > I modified the code a get the following results. Unfortunetly only a little > more as expected: > > DROP TABLE 'tblZO_Haupt'; > CREATE TABLE 'tblZO_Haupt' ('id' INTEGER PRIMARY KEY, 'zo_tblEnsemble' > INTEGER, 'zo_tblSaenger' INTEGER,

Re: [sqlite] Problems with max(datestamp) in subquery

2009-08-12 Thread Leo Freitag
P Kishor-3 wrote: > > On Mon, Aug 10, 2009 at 2:25 PM, Leo Freitag > wrote: > > sqlite> SELECT * FROM haupt WHERE datestamp = (SELECT Max(datestamp) > FROM haupt WHERE "group" = 1 AND song = 1); > 3|1|2|1|11|2009-08-04 > sqlite> > > Although, I would *seriously*

Re: [sqlite] Problems with max(datestamp) in subquery

2009-08-10 Thread P Kishor
On Mon, Aug 10, 2009 at 2:25 PM, Leo Freitag wrote: > Hello, > > in table haupt I store information about group, singer, song, voice and > datestamp. > > [CODE] > CREATE TABLE 'haupt' ('id' INTEGER PRIMARY KEY, 'group' INTEGER, > 'singer' INTEGER, 'song' INTEGER, >  

[sqlite] Problems with max(datestamp) in subquery

2009-08-10 Thread Leo Freitag
Hello, in table haupt I store information about group, singer, song, voice and datestamp. [CODE] CREATE TABLE 'haupt' ('id' INTEGER PRIMARY KEY, 'group' INTEGER, 'singer' INTEGER, 'song' INTEGER, 'voice' INTEGER, 'datestamp' TEXT); INSERT INTO "haupt" VALUES(1, 1, 1, 1, 11, '2009-08-01');