SELECT id, ordine as ordinex, titolo_it as titolo, immagine , dettaglio_testo_it as testo , immagine , video_it as video , (select permalink_it from articoli where ordine = (select min(ordine) from articoli where ordine > ordinex) AND attivo = 'on' AND titolo_it != '') as prevpermalink , (select titolo_it from articoli where ordine = (select min(ordine) from articoli where ordine > ordinex) AND attivo = 'on' AND titolo_it != '') as prevtitle , (select permalink_it from articoli where ordine = (select max(ordine) from articoli where ordine < ordinex) AND attivo = 'on' AND titolo_it != '') as nextpermalink , (select titolo_it from articoli where ordine = (select max(ordine) from articoli where ordine < ordinex) AND attivo = 'on' AND titolo_it != '') as nexttitle FROM articoli WHERE permalink_it = 'parapedonale-trento' LIMIT 1
Deadlock found when trying to get lock; try restarting transaction