SELECT a.*, CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,c.title AS parent_title
FROM mnss_djmt_albums AS a
LEFT JOIN mnss_djmt_albums AS c ON c.id = a.parent_id
WHERE a.published = 1 AND a.visible = 1 AND a.parent_id = 109
ORDER BY ordering ASC
1
2
3
4
5
6
7
8
9
10
11
12
13
13a
14
15
16
17
18
19
19a
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
38a
39
40
40a
40b
40c
41
41a
42
42a
42b
42c
43
43a
43b
44
45
46
47