Thursday, December 12, 2019

Re: orm relation


Hi We are worlds first affordable Python, Django Based Commpany,
And can help you in this and related tasks / projects immidiately mere at $7 per hour
Best Regards,
Divyesh Khamele,
Pythonmate

On Sun, 1 Dec 2019 at 19:39, bill dexter <55dexter55@gmail.com> wrote:
ELECT a.matr
      ,[nom]
      ,[prn]
      ,cast([dat_nais] as date) as dat_nais
  , (YEAR(getdate()) - YEAR(dat_nais)) as age
      ,cast([dat_deces] as date) as dat_deces
      ,cast([dat_imm] as date) as dat_imm
      ,cast([dat_aj] as date) as dat_j
      ,[cod_position]
  ,YEAR(dat_imm) as anne_imm
  ,YEAR(dat_encais) as ann_regl
      ,[annee]
      ,[cod_nat]
      ,cast([dat_e

Snc] as date) as dat_regl
      ,[mt_encais]
  FROM users a
left join enca e on e.matr = a.matr
left join encr c on (c.cod_encais = e.cod_encais)
  where (YEAR(c.dat_enc) - c.annee > 3 ) and ((YEAR(getdate()) - YEAR(a.dat_nais)) between 54 and 70) and c.cod_nat = 'CN'
  order by a.nom_, a.prn, c.annee asc;

hello;
my models are users, enca; encr;
who can i performe this query using django ORM, note that i'm using MSSQL; thank very much

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/85f7f91b-0f52-4a96-8700-bee588eb4a3d%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAH9mneUNafffdDN0pE%2BCry_8-yGrYeWw1eziaRRe0znoskLmCQ%40mail.gmail.com.

No comments:

Post a Comment