db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerd Meyer" <gerd_mey...@freenet.de>
Subject Date Query
Date Wed, 26 Jul 2006 23:53:34 GMT
Hello,
 
i want to do a query with DATE object in mysql.
 
I´ve got the folling table structure:
 
  <table name="download_list">
    <column name="id"                             type="INTEGER"
required="true"       primaryKey="true"             autoIncrement="true"
/>
    <column name="ListID"                         type="INTEGER"  />
    <column name="LastUpdate"                     type="DATE"     />
    <column name="DownloadLink"                   type="VARCHAR"
size="120"   />
    <unique>
                                   <unique-column name="ListID"/>
    </unique>    
  </table>
  <table name="partner">
    <column name="id"                             type="INTEGER"
required="true"       primaryKey="true"             autoIncrement="true"
/>
    <column name="listID"                         type="INTEGER"
required="true"       />
<column name="downloadActive"         type="INTEGER"  size="1"
required="true"                                  default="0"          />
    <unique>
                                   <unique-column name="listID"/>
    </unique>     
  </table>
    <table name="partner_imports">
    <column name="id"                             type="INTEGER"
required="true"       primaryKey="true"             autoIncrement="true"
/>
    <column name="partner_id"           type="INTEGER"
required="true"       />
    <column name="lastupdate"                     type="DATE"
required="true"       />
    <column name="download_begin"                 type="DATE"
/>
    <column name="download_end"                   type="DATE"
/>
    <foreign-key foreignTable="partner">
        <reference local="partner_id" foreign="id"/>
    </foreign-key>   
    <unique>
                                   <unique-column name="partner_id"/>
                                   <unique-column name="lastupdate"/>
    </unique>  
  </table>   
 
 
Now i want to make a query, which give´s me all data lines of table
“download_list”,
If  column downloadActive  of table partner is = 1
AND
If the LastUpdate of the table download_list is newer than lastupdate of
table partner_imports
 
Can anyone help me with the solution !?
 
Thanks
Gerd

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message