[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] SQL: mange unions ?



Martin Møller Skarbiniks Pedersen skrev:
> On 03/07/07, "E. Sjørlund" <sslug@sslug> wrote:
> 
>> Det ser ud som om din tabel har fem forskellige datoer pr. post. Er det
>> rigtigt?
>>
> 
> Jep. Jeg overvejede en ekstra tabel til at gemme disse datoer, så jeg
> kunne have flere end fem datoer pr. post, men produktionen mener at 5
> altid er nok.
> 
> Situationen er den, at produktionen printer et job med et unikt job-id, men
> de får ikke det hele sendt samme dag, da noget skal hånd-kuverteres,
> derfor har jeg
> fem dato-felter.
> 
> Mvh
> Martin
> 

SELECT * FROM tickets t, customers c WHERE
 t.customer=c.id
AND
c.name='$customer'
AND
(
( post_1_date>=to_date('$start','YYYY-MM-DD')
 AND
  post_1_date<=to_date('$end','YYYY-MM-DD')
)
or
(
 post_2_date>=to_date('$start','YYYY-MM-DD')
AND
 post_2_date<=to_date('$end','YYYY-MM-DD')
)
or
osv
)

Om det så er mere elegant ved jeg ikke rigtigt, men i det mindste burde
serveren stoppe testen ved første post_X der er OK, og du får kun en
post som svar.


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2007-08-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *