Mistři v programování na #hovnokod

Aneb když se mi zdá, že málo vyhledávám.

SELECT village_part_description_id
FROM village_part_description_assignment
WHERE village_part_description_id = 78

Zbyněk Rybička,

Kde se konají schůzky? Nejspíš v hospodě, protože jen tam se člověk směje.

select begin as start, end, ':-)' as title from meetings

Zbyněk Rybička,

Miluji subselecty

select * from items where client_id in (select client_id from clients where client_id = 43820)

Anonymous,

Ked isnull proste nestaci ..

... cast(case when isnull(pz.email, '') <> '' then pz.email else '' end as varchar(500)) as [E-mail] ...

Anonymous,

A tohle je v pohledu, kam se posílají další dotazy, takže se to provádí furt dokola. A Adminer to vyplivnul všechno na 1 řádku.

SELECT
	product.product_id, product.producer_id, product.style_id, product.dodavatel_id, product.old_navi, product_info.short_info, product_info.long_info,
	product_info.language_id, product_info.product_name, product_info.seo_title, product_info.seo_keywords, product_info.seo_description,
	minprices."row", minprices.product_spec_id, minprices.sleva, minprices.interni_id
FROM
	(
		(
			(product JOIN product_info USING (product_id))
			JOIN (
				SELECT store_central.product_id
				FROM store_central
				WHERE (store_central.units >= (-1000))

				UNION SELECT sety_skupiny.product_id
				FROM sety_skupiny
				WHERE (sety_skupiny.typ = 3)
			) used_product USING (product_id)
		)
		JOIN (
			SELECT
				product_spec.product_id, product_spec."row", min(product_spec.product_spec_id) AS product_spec_id,
				min(product_spec.interni_id) AS interni_id, min(product_spec.sleva) AS sleva
			FROM (
				product_spec JOIN (
					SELECT
						product_spec.product_id, min(product_spec."row") AS "row"
					FROM
						product_spec
					WHERE
						(
							(
								(product_spec."row" <> (0)::numeric)
								AND (
									product_spec.product_spec_id IN (
										SELECT store_central.product_spec_id
										FROM store_central
										WHERE (store_central.units >= (-1000))
									)
								)
							)
							OR
							(
								product_spec.product_id IN (
									SELECT sety_skupiny.product_id
									FROM sety_skupiny
									WHERE (sety_skupiny.typ = 3)
								)
							)
						)
					GROUP BY
						product_spec.product_id
				) minp USING (product_id, "row")
			)
			GROUP BY
				product_spec.product_id, product_spec."row"
		) minprices USING (product_id)
	)
	WHERE (
		(product_info.product_name <> ''::text)
		AND (
			NOT (
				product.product_id IN (
					SELECT product_notshow_2.product_id
					FROM product_notshow_2
				)
			)
		)
	);

Anonymous,