SELECT
	x.word_id AS from_word_id,
	x.language AS from_language,
	x.lemma AS from_lemma,
	x.pronunciation AS from_pronunciation,
	x.concept_id AS from_concept_id,
	x.strength AS from_strength,
	y.word_id AS to_word_id,
	y.language AS to_language,
	y.lemma AS to_lemma,
	y.pronunciation AS to_pronunciation,
	y.concept_id AS to_concept_id,
	y.strength AS to_strength
FROM
	(
			(
				SELECT
					x3.word_id AS word_id,
					x3.language AS language,
					x3.lemma AS lemma,
					x3.pronunciation AS pronunciation,
					x4.concept_id AS concept_id,
					x4.strength AS strength
				FROM
					(
							(
								SELECT
									x2.id AS word_id,
									x1.iso_639_2 AS language,
									x2.lemma AS lemma,
									x2.pronunciation AS pronunciation
								FROM
									(
											(
												SELECT
													id,
													iso_639_2
												FROM
													languages
											) AS x1
										INNER JOIN
											(
												SELECT
													id,
													language_id,
													lemma,
													pronunciation
												FROM
													words
											) AS x2
										ON
											(x1.id = x2.language_id)
									)
							) AS x3
						INNER JOIN
							correlations AS x4
						ON
							(x3.word_id = x4.word_id)
					)
			) AS x
		INNER JOIN
			(
				SELECT
					y3.word_id AS word_id,
					y3.language AS language,
					y3.lemma AS lemma,
					y3.pronunciation AS pronunciation,
					y4.concept_id AS concept_id,
					y4.strength AS strength
				FROM
					(
							(
								SELECT
									y2.id AS word_id,
									y1.iso_639_2 AS language,
									y2.lemma AS lemma,
									y2.pronunciation AS pronunciation
								FROM
									(
											(
												SELECT
													id,
													iso_639_2
												FROM
													languages
											) AS y1
										INNER JOIN
											(
												SELECT
													id,
													language_id,
													lemma,
													pronunciation
												FROM
													words
											) AS y2
										ON
											(y1.id = y2.language_id)
									)
							) AS y3
						INNER JOIN
							correlations AS y4
						ON
							(y3.word_id = y4.word_id)
					)
			) AS y
		ON
			(x.concept_id = y.concept_id)
	)
WHERE
	(
		(
			(from_language = '${language}')
			AND
			(from_lemma LIKE '%${lemma}%')
		)
		AND
		NOT (
			(from_language = to_language)
			AND
			(from_lemma = to_lemma)
		)
	)
;

