Mistři v programování na #hovnokod

Ano, skoro som to spustil. Debilna bodkociarka.

UPDATE x.auctions
SET public = 1;
WHERE public = 0 AND id = 515;

Anonymous,

Když neveříte REPLACE :D

WHILE CHARINDEX('--', @RES) > 0
	BEGIN
		SET @RES = REPLACE(@RES, '--', '-')
	END
	
	RETURN @RES

END

Lukáš Luska,

K německým kolegům zřejmě ještě nedorazila vymoženost funkce COALESCE

          CASE 
           WHEN NULLIF([Packing Material], 'Not assigned') IS NULL
             OR [Packing Material] = '' 
            THEN
             CASE 
              WHEN NULLIF (Material, 'Not assigned') IS NULL
                OR Material = '' 
               THEN
                CASE 
                 WHEN NULLIF ([Reporting Brand], 'Not assigned') IS NULL 
                   OR [Reporting Brand] = '' 
                  THEN '#' 
                 ELSE [Reporting Brand] + '_#' 
                END 
               ELSE Material 
              END 
             ELSE [Packing Material] 
            END AS BRANDS, 

Anonymous,

Zeby nova syntax Oraclu, o ktorej este neviem? Ale kdeze... ved naco by clovek pouzil LISTAGG, ked moze vytvorit svoju vlastnu funkciu, navyse s takym krasnym nazvom!

select join(
cursor(
select xxx 
FROM yyy, zzz  
WHERE ...
),',')
from dual;


function join
(
    p_cursor sys_refcursor,
    p_del varchar2 := ','
) return varchar2
is
    l_value   varchar2(32767);
    l_result  varchar2(32767);
begin
    loop
        fetch p_cursor into l_value;
        exit when p_cursor%notfound;
        if l_result is not null then
            l_result := l_result || p_del;
        end if;
        l_result := l_result || l_value;
    end loop;
    return l_result;
end join;

Anonymous,

s kolegom sme riesili pocty zaznamov v tabulke, ale bolo tam par duplikatnych zaznamov, tak sme ich potrebovali vyfiltrovat, ja som to robil pomocou jedneho stlpcu, ktory indikoval duplicitu, on to robil pomocou distinct, co by tiez malo stacit, tak som sa ho opytal, nech mi posle jeho query, no a ked som to videl, tak som vsetko pochopil

select distinct count(*) from fcm_sync.cmd_cas_number;

Anonymous,