daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Dec 18th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT faktura.suma_DPH as Suma, faktura.datum as Datum,
  2.        organizacia.nazov as N, organizacia.pravna_forma as PF, organizacia.ICO,
  3.        odoberatel.nazov_obce as Odoberatel,
  4.        organizacia.sidlo as Obec, null as PopCislo, null as PSC, null as Ulica,
  5.   spolocnik.meno, null as Priezvisko,
  6.   spolocnik.sidlo as ObecVL, null as PopCisloVL, null as PSCVL, null as UlicaVL,
  7.   koncovy_uzivatelia as MenoKUV, null as PriezviskoKUV,
  8.   koncovy_uzivatelia_adresy as ObecKUV,  null as PopCisloKUV, null as PSCKUV, null as UlicaKUV
  9.  
  10. FROM michalovce.faktura
  11.  
  12.   left join michalovce.odoberatel on odoberatel.ICO = faktura.ICO_odoberatel
  13.   left join michalovce.organizacia on organizacia.ICO = faktura.ICO_organizacia
  14.   left join (Select * from michalovce.spolocnik group by spolocnik.ICO) as spolocnik on spolocnik.ICO = organizacia.ICO
  15.   LEFT JOIN (SELECT *, group_concat(kuv_table.meno, ', ') as koncovy_uzivatelia, group_concat(kuv_table.adresa, ', ') as koncovy_uzivatelia_adresy FROM kuv_organizacia kuv JOIN kuv kuv_table ON kuv.ID_kuv = kuv_table.ID GROUP BY kuv.ICO_organizacia) as kuuv on kuuv.ICO_organizacia=organizacia.ICO;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top