Skip to content

Instantly share code, notes, and snippets.

@MaxMorais
Created May 10, 2019 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaxMorais/655f118367d382b5e207305eb6623ecf to your computer and use it in GitHub Desktop.
Save MaxMorais/655f118367d382b5e207305eb6623ecf to your computer and use it in GitHub Desktop.
SELECT DISTINCT
SUBSTRING_INDEX(SUBSTRING_INDEX(x.`Serial No:Link/Serial No:150`, '\n', n.i + 1), '\n', -1) as "Serial No:Link/Serial No:150",
x.`DocType:Data:100` as "DocType:Data:100",
x.`DocName:Dynamic Link/DocType:100` as "DocName:Dynamic Link/DocType:100",
x.`Date:Date:75` as "Date:Date:75",
x.`Item Group:Link/Item Group:150` as "Item Group:Link/Item Group:150",
x.`Item:Link/Item:150` as "Item:Link/Item:150",
x.`Item Name:Data:250` as "Item Name:Data:250",
x.`Packed Into:Link/Item:150` as "Packed Into:Link/Item:150",
x.`Stock UOM:Link/UOM:75` as "Stock UOM:Link/UOM:75",
x.`From Warehouse:Link/Warehouse:200` as "From Warehouse:Link/Warehouse:200",
x.`To Warehouse:Link/Warehouse:200` as "To Warehouse:Link/Warehouse:200",
x.`To Party:Data:100` as "To Party:Data:100",
x.`To:Dynamic Link/To Party:200` as "To:Dynamic Link/To Party:200",
x.`To Name:Data:200` as "To Name:Data:200",
x.`From Party:Data:200` as "From Party:Data:200",
x.`From:Dynamic Link/From Party:200` as "From:Dynamic Link/From Party:200",
x.`From Name:Data:200` as "From Name:Data:200"
FROM
(SELECT
`tabSales Invoice Item`.serial_no as "Serial No:Link/Serial No:150",
"Sales Invoice" as "DocType:Data:100",
`tabSales Invoice Item`.parent as "DocName:Dynamic Link/DocType:100",
`tabSales Invoice`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabSales Invoice Item`.item_code as "Item:Link/Item:150",
`tabSales Invoice Item`.item_name as "Item Name:Data:250",
NULL as "Packed Into:Link/Item:150",
`tabSales Invoice Item`.stock_uom as "Stock UOM:Link/UOM:75",
`tabSales Invoice Item`.warehouse as "From Warehouse:Link/Warehouse:200",
NULL as "To Warehouse:Link/Warehouse:200",
"Customer" as "To Party:Data:100",
`tabSales Invoice`.customer as "To:Dynamic Link/To Party:200",
`tabSales Invoice`.customer_name as "To Name:Data:200",
NULL as "From Party:Data:200",
NULL as "From:Dynamic Link/From Party:200",
NULL as "From Name:Data:200"
FROM `tabSales Invoice Item`
INNER JOIN `tabSales Invoice` ON `tabSales Invoice`.`name` = `tabSales Invoice Item`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabSales Invoice Item`.`item_code`
WHERE `tabSales Invoice`.`update_stock` = 1 AND `tabSales Invoice`.`docstatus` = 1 AND `tabSales Invoice`.`is_return` = 0 AND ifnull(`tabSales Invoice Item`.serial_no , "")!= ""
UNION ALL
SELECT
`tabPacked Item`.serial_no as "Serial No:Link/Serial No:150",
"Sales Invoice" as "DocType:Data:150",
`tabPacked Item`.parent as "DocName:Dynamic Link/DocType:150",
`tabSales Invoice`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabPacked Item`.item_code as "Item:Link/Item:150",
`tabItem`.item_name as "Item Name:Data:250",
`tabPacked Item`.`parent_item` as "Packed Into:Link/Item:150",
`tabPacked Item`.uom as "Stock UOM:Link/UOM:75",
`tabPacked Item`.warehouse as "From Warehouse:Link/Warehouse:200",
`tabPacked Item`.target_warehouse as "To Warehouse:Link/Warehouse:200",
"Customer" as "To Party:Data:100",
`tabSales Invoice`.customer as "To:Dynamic Link/To Party:200",
`tabSales Invoice`.customer_name as "To Name:Data:200",
NULL as "From Party:Data:200",
NULL as "From:Dynamic Link/From Party:200",
NULL as "From Name:Data:200"
FROM `tabPacked Item`
INNER JOIN `tabSales Invoice` ON `tabSales Invoice`.`name` = `tabPacked Item`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabPacked Item`.`item_code`
WHERE `tabSales Invoice`.`update_stock` = 1 AND `tabSales Invoice`.`docstatus` = 1 AND `tabSales Invoice`.`is_return` = 0 AND ifnull(`tabPacked Item`.`serial_no`, "")!=""
UNION ALL
SELECT
`tabSales Invoice Item`.serial_no as "Serial No:Link/Serial No:150",
"Sales Invoice" as "DocType:Data:150",
`tabSales Invoice Item`.parent as "DocName:Dynamic Link/DocType:150",
`tabSales Invoice`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabSales Invoice Item`.item_code as "Item:Link/Item:150",
`tabSales Invoice Item`.item_name as "Item Name:Data:250",
NULL as "Packed Into:Link/Item:150",
`tabSales Invoice Item`.stock_uom as "Stock UOM:Link/UOM:75",
NULL as "From Warehouse:Link/Warehouse:200",
`tabSales Invoice Item`.warehouse as "To Warehouse:Link/Warehouse:200",
NULL as "To Party:Data:200",
NULL as "To:Dynamic Link/To Party:200",
NULL as "To Name:Data:200",
"Customer" as "From Party:Data:100",
`tabSales Invoice`.customer as "From Party:Dynamic Link/From Party:200",
`tabSales Invoice`.customer_name as "From Name:Data:200"
FROM `tabSales Invoice Item`
INNER JOIN `tabSales Invoice` ON `tabSales Invoice`.`name` = `tabSales Invoice Item`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabSales Invoice Item`.`item_code`
WHERE `tabSales Invoice`.`update_stock` = 1 AND `tabSales Invoice`.`docstatus` = 1 AND `tabSales Invoice`.`is_return` = 1 AND ifnull(`tabSales Invoice Item`.serial_no , "")!= ""
UNION ALL
SELECT
`tabPacked Item`.serial_no as "Serial No:Link/Serial No:150",
"Sales Invoice" as "DocType:Data:150",
`tabPacked Item`.parent as "DocName:Dynamic Link/DocType:150",
`tabSales Invoice`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabPacked Item`.item_code as "Item:Link/Item:150",
`tabItem`.item_name as "Item Name:Data:250",
`tabPacked Item`.`parent_item` as "Packed Into:Link/Item:150",
`tabPacked Item`.uom as "Stock UOM:Link/UOM:75",
`tabPacked Item`.target_warehouse as "From Warehouse:Link/Warehouse:200",
`tabPacked Item`.warehouse as "To Warehouse:Link/Warehouse:200",
NULL as "To Party:Data:200",
NULL as "To:Dynamic Link/To Party:200",
NULL as "To Name:Data:200",
"Customer" as "From Party:Data:100",
`tabSales Invoice`.customer as "From:Dynamic Link/From Party:200",
`tabSales Invoice`.customer_name as "From Name:Data:200"
FROM `tabPacked Item`
INNER JOIN `tabSales Invoice` ON `tabSales Invoice`.`name` = `tabPacked Item`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabPacked Item`.`item_code`
WHERE `tabSales Invoice`.`update_stock` = 1 AND `tabSales Invoice`.`docstatus` = 1 AND `tabSales Invoice`.`is_return` = 1 AND ifnull(`tabPacked Item`.`serial_no`, "")!=""
UNION ALL
SELECT
`tabDelivery Note Item`.serial_no as "Serial No:Link/Serial No:150",
"Delivery Note" as "DocType:Data:100",
`tabDelivery Note Item`.parent as "DocName:Dynamic Link/DocType:100",
`tabDelivery Note`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabDelivery Note Item`.item_code as "Item:Link/Item:150",
`tabDelivery Note Item`.item_name as "Item Name:Data:250",
NULL as "Packed Into:Link/Item:150",
`tabDelivery Note Item`.stock_uom as "Stock UOM:Link/UOM:75",
`tabDelivery Note Item`.warehouse as "From Warehouse:Link/Warehouse:200",
NULL as "To Warehouse:Link/Warehouse:200",
"Customer" as "To Party:Data:100",
`tabDelivery Note`.customer as "To:Dynamic Link/To Party:200",
`tabDelivery Note`.customer_name as "To Name:Data:200",
NULL as "From Party:Data:200",
NULL as "From:Dynamic Link/From Party:200",
NULL as "From Name:Data:200"
FROM `tabDelivery Note Item`
INNER JOIN `tabDelivery Note` ON `tabDelivery Note`.`name` = `tabDelivery Note Item`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabDelivery Note Item`.`item_code`
WHERE `tabDelivery Note`.`docstatus` = 1 AND `tabDelivery Note`.`is_return` = 0 AND ifnull(`tabDelivery Note Item`.serial_no , "")!= ""
UNION ALL
SELECT
`tabPacked Item`.serial_no as "Serial No:Link/Serial No:150",
"Delivery Note" as "DocType:Data:150",
`tabPacked Item`.parent as "DocName:Dynamic Link/DocType:150",
`tabDelivery Note`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabPacked Item`.item_code as "Item:Link/Item:150",
`tabItem`.item_name as "Item Name:Data:250",
`tabPacked Item`.`parent_item` as "Packed Into:Link/Item:150",
`tabPacked Item`.uom as "Stock UOM:Link/UOM:75",
`tabPacked Item`.warehouse as "From Warehouse:Link/Warehouse:200",
`tabPacked Item`.target_warehouse as "To Warehouse:Link/Warehouse:200",
"Customer" as "To Party:Data:100",
`tabDelivery Note`.customer as "To:Dynamic Link/To Party:200",
`tabDelivery Note`.customer_name as "To Name:Data:200",
NULL as "From Party:Data:200",
NULL as "From:Dynamic Link/From Party:200",
NULL as "From Name:Data:200"
FROM `tabPacked Item`
INNER JOIN `tabDelivery Note` ON `tabDelivery Note`.`name` = `tabPacked Item`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabPacked Item`.`item_code`
WHERE `tabDelivery Note`.`docstatus` = 1 AND `tabDelivery Note`.`is_return` = 0 AND ifnull(`tabPacked Item`.`serial_no`, "")!=""
UNION ALL
SELECT
`tabDelivery Note Item`.serial_no as "Serial No:Link/Serial No:150",
"Delivery Note" as "DocType:Data:150",
`tabDelivery Note Item`.parent as "DocName:Dynamic Link/DocType:150",
`tabDelivery Note`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabDelivery Note Item`.item_code as "Item:Link/Item:150",
`tabDelivery Note Item`.item_name as "Item Name:Data:250",
NULL as "Packed Into:Link/Item:150",
`tabDelivery Note Item`.stock_uom as "Stock UOM:Link/UOM:75",
NULL as "From Warehouse:Link/Warehouse:200",
`tabDelivery Note Item`.warehouse as "To Warehouse:Link/Warehouse:200",
NULL as "To Party:Data:200",
NULL as "To:Dynamic Link/To Party:200",
NULL as "To Name:Data:200",
"Customer" as "From Party:Data:100",
`tabDelivery Note`.customer as "From Party:Dynamic Link/From Party:200",
`tabDelivery Note`.customer_name as "From Name:Data:200"
FROM `tabDelivery Note Item`
INNER JOIN `tabDelivery Note` ON `tabDelivery Note`.`name` = `tabDelivery Note Item`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabDelivery Note Item`.`item_code`
WHERE `tabDelivery Note`.`docstatus` = 1 AND `tabDelivery Note`.`is_return` = 1 AND ifnull(`tabDelivery Note Item`.serial_no , "")!= ""
UNION ALL
SELECT
`tabPacked Item`.serial_no as "Serial No:Link/Serial No:150",
"Delivery Note" as "DocType:Data:150",
`tabPacked Item`.parent as "DocName:Dynamic Link/DocType:150",
`tabDelivery Note`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabPacked Item`.item_code as "Item:Link/Item:150",
`tabItem`.item_name as "Item Name:Data:250",
`tabPacked Item`.`parent_item` as "Packed Into:Link/Item:150",
`tabPacked Item`.uom as "Stock UOM:Link/UOM:75",
`tabPacked Item`.target_warehouse as "From Warehouse:Link/Warehouse:200",
`tabPacked Item`.warehouse as "To Warehouse:Link/Warehouse:200",
NULL as "To Party:Data:200",
NULL as "To:Dynamic Link/To Party:200",
NULL as "To Name:Data:200",
"Customer" as "From Party:Data:100",
`tabDelivery Note`.customer as "From:Dynamic Link/From Party:200",
`tabDelivery Note`.customer_name as "From Name:Data:200"
FROM `tabPacked Item`
INNER JOIN `tabDelivery Note` ON `tabDelivery Note`.`name` = `tabPacked Item`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabPacked Item`.`item_code`
WHERE `tabDelivery Note`.`docstatus` = 1 AND `tabDelivery Note`.`is_return` = 1 AND ifnull(`tabPacked Item`.`serial_no`, "")!=""
UNION ALL
SELECT
`tabStock Entry Detail`.serial_no as "Serial No:Link/Serial No:150",
"Stock Entry" as "DocType:Data:80",
`tabStock Entry Detail`.parent as "DocName:Dynamic Link/DocType:100",
`tabStock Entry`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabStock Entry Detail`.item_code as "Item:Link/Item:150",
`tabStock Entry Detail`.item_name as "Item Name:Data:250",
NULL as "Packed Into:Link/Item:150",
`tabStock Entry Detail`.stock_uom as "Stock UOM:Link/UOM:75",
`tabStock Entry Detail`.s_warehouse as "From Warehouse:Link/Warehouse:200",
`tabStock Entry Detail`.t_warehouse as "To Warehouse:Link/Warehouse:200",
NULL as "To Party:Data:200",
NULL as "To:Dynamic Link/To Party:200",
NULL as "To Name:Data:200",
NULL as "From Party:Data:200",
NULL AS "From:Dynamic Link/From Party:200",
NULL as "From Name:Data:200"
FROM `tabStock Entry Detail`
INNER JOIN `tabStock Entry` ON `tabStock Entry`.`name` = `tabStock Entry Detail`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabStock Entry Detail`.`item_code`
WHERE `tabStock Entry`.`docstatus` = 1 AND trim(ifnull(`tabStock Entry Detail`.serial_no , ""))!= "" AND `tabStock Entry`.`purpose` IN ("Material Issue", "Material Transfer", "Material Receipt")
UNION ALL
SELECT
`tabPurchase Receipt Item`.serial_no as "Serial No:Link/Serial No:150",
"Purchase Receipt" as "DocType:Data:100",
`tabPurchase Receipt Item`.parent as "DocName:Dynamic Link/DocType:100",
`tabPurchase Receipt`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabPurchase Receipt Item`.item_code as "Item:Link/Item:150",
`tabPurchase Receipt Item`.item_name as "Item Name:Data:250",
NULL as "Packed Into:Link/Item:150",
`tabPurchase Receipt Item`.stock_uom as "Stock UOM:Link/UOM:75",
NULL as "From Warehouse:Link/Warehouse:200",
`tabPurchase Receipt Item`.warehouse as "To Warehouse:Link/Warehouse:200",
NULL as "To Party:Data:100",
NULL as "To:Dynamic Link/To Party:200",
NULL as "To Name:Data:200",
"Supplier" as "From Party:Data:200",
`tabPurchase Receipt`.supplier as "From:Dynamic Link/From Party:200",
`tabPurchase Receipt`.supplier as "From Name:Data:200"
FROM `tabPurchase Receipt Item`
INNER JOIN `tabPurchase Receipt` ON `tabPurchase Receipt`.`name` = `tabPurchase Receipt Item`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabPurchase Receipt Item`.`item_code`
WHERE `tabPurchase Receipt`.`docstatus` = 1 AND `tabPurchase Receipt`.`is_return` = 0 AND ifnull(`tabPurchase Receipt Item`.serial_no , "")!= ""
UNION ALL
SELECT
`tabPacked Item`.serial_no as "Serial No:Link/Serial No:150",
"Purchase Receipt" as "DocType:Data:150",
`tabPacked Item`.parent as "DocName:Dynamic Link/DocType:150",
`tabPurchase Receipt`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabPacked Item`.item_code as "Item:Link/Item:150",
`tabItem`.item_name as "Item Name:Data:250",
`tabPacked Item`.`parent_item` as "Packed Into:Link/Item:150",
`tabPacked Item`.uom as "Stock UOM:Link/UOM:75",
NULL as "From Warehouse:Link/Warehouse:200",
`tabPacked Item`.target_warehouse as "To Warehouse:Link/Warehouse:200",
NULL as "To Party:Data:100",
NULL as "To:Dynamic Link/To Party:200",
NULL as "To Name:Data:200",
"Supplier" as "From Party:Data:200",
`tabPurchase Receipt`.supplier as "From:Dynamic Link/From Party:200",
`tabPurchase Receipt`.supplier as "From Name:Data:200"
FROM `tabPacked Item`
INNER JOIN `tabPurchase Receipt` ON `tabPurchase Receipt`.`name` = `tabPacked Item`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabPacked Item`.`item_code`
WHERE `tabPurchase Receipt`.`docstatus` = 1 AND `tabPurchase Receipt`.`is_return` = 0 AND ifnull(`tabPacked Item`.`serial_no`, "")!=""
UNION ALL
SELECT
`tabPurchase Receipt Item`.serial_no as "Serial No:Link/Serial No:150",
"Purchase Receipt" as "DocType:Data:150",
`tabPurchase Receipt Item`.parent as "DocName:Dynamic Link/DocType:150",
`tabPurchase Receipt`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabPurchase Receipt Item`.item_code as "Item:Link/Item:150",
`tabPurchase Receipt Item`.item_name as "Item Name:Data:250",
NULL as "Packed Into:Link/Item:150",
`tabPurchase Receipt Item`.stock_uom as "Stock UOM:Link/UOM:75",
NULL as "From Warehouse:Link/Warehouse:200",
`tabPurchase Receipt Item`.warehouse as "To Warehouse:Link/Warehouse:200",
"Supplier" as "To Party:Data:100",
`tabPurchase Receipt`.supplier as "To:Dynamic Link/To Party:200",
`tabPurchase Receipt`.supplier as "To Name:Data:200",
NULL as "From Party:Data:200",
NULL as "From:Dynamic Link/From Party:200",
NULL as "From Name:Data:200"
FROM `tabPurchase Receipt Item`
INNER JOIN `tabPurchase Receipt` ON `tabPurchase Receipt`.`name` = `tabPurchase Receipt Item`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabPurchase Receipt Item`.`item_code`
WHERE `tabPurchase Receipt`.`docstatus` = 1 AND `tabPurchase Receipt`.`is_return` = 1 AND ifnull(`tabPurchase Receipt Item`.serial_no , "")!= ""
UNION ALL
SELECT
`tabPacked Item`.serial_no as "Serial No:Link/Serial No:150",
"Purchase Receipt" as "DocType:Data:150",
`tabPacked Item`.parent as "DocName:Dynamic Link/DocType:150",
`tabPurchase Receipt`.`posting_date` as "Date:Date:75",
`tabItem`.`item_group` as "Item Group:Link/Item Group:150",
`tabPacked Item`.item_code as "Item:Link/Item:150",
`tabItem`.item_name as "Item Name:Data:250",
`tabPacked Item`.`parent_item` as "Packed Into:Link/Item:150",
`tabPacked Item`.uom as "Stock UOM:Link/UOM:75",
NULL as "From Warehouse:Link/Warehouse:200",
`tabPacked Item`.target_warehouse as "To Warehouse:Link/Warehouse:200",
"Supplier" as "To Party:Data:100",
`tabPurchase Receipt`.supplier as "To:Dynamic Link/To Party:200",
`tabPurchase Receipt`.supplier as "To Name:Data:200",
NULL as "From Party:Data:200",
NULL as "From:Dynamic Link/From Party:200",
NULL as "From Name:Data:200"
FROM `tabPacked Item`
INNER JOIN `tabPurchase Receipt` ON `tabPurchase Receipt`.`name` = `tabPacked Item`.`parent`
INNER JOIN `tabItem` ON `tabItem`.`name` = `tabPacked Item`.`item_code`
WHERE `tabPurchase Receipt`.`docstatus` = 1 AND `tabPurchase Receipt`.`is_return` = 1 AND ifnull(`tabPacked Item`.`serial_no`, "")!="") x, (
SELECT 1 i
UNION SELECT 2
UNION SELECT 3
UNION SELECT 4
UNION SELECT 5
UNION SELECT 6
UNION SELECT 7
UNION SELECT 8
UNION SELECT 9
UNION SELECT 10
UNION SELECT 11
UNION SELECT 12
UNION SELECT 13
UNION SELECT 14
UNION SELECT 15
UNION SELECT 16
UNION SELECT 17
UNION SELECT 18
UNION SELECT 19
UNION SELECT 20
UNION SELECT 21
UNION SELECT 22
UNION SELECT 23
UNION SELECT 24
UNION SELECT 25
UNION SELECT 26
UNION SELECT 27
UNION SELECT 28
UNION SELECT 29
UNION SELECT 30
UNION SELECT 31
UNION SELECT 32
UNION SELECT 33
UNION SELECT 34
UNION SELECT 35
UNION SELECT 36
UNION SELECT 37
UNION SELECT 38
UNION SELECT 39
UNION SELECT 40
UNION SELECT 41
UNION SELECT 42
UNION SELECT 43
UNION SELECT 44
UNION SELECT 45
UNION SELECT 46
UNION SELECT 47
UNION SELECT 48
UNION SELECT 49
UNION SELECT 50
UNION SELECT 51
UNION SELECT 52
UNION SELECT 53
UNION SELECT 54
UNION SELECT 55
UNION SELECT 56
UNION SELECT 57
UNION SELECT 58
UNION SELECT 59
UNION SELECT 60
UNION SELECT 61
UNION SELECT 62
UNION SELECT 63
UNION SELECT 64
UNION SELECT 65
UNION SELECT 66
UNION SELECT 67
UNION SELECT 68
UNION SELECT 69
UNION SELECT 70
UNION SELECT 71
UNION SELECT 72
UNION SELECT 73
UNION SELECT 74
UNION SELECT 75
UNION SELECT 76
UNION SELECT 77
UNION SELECT 78
UNION SELECT 79
UNION SELECT 80
UNION SELECT 81
UNION SELECT 82
UNION SELECT 83
UNION SELECT 84
UNION SELECT 85
UNION SELECT 86
UNION SELECT 87
UNION SELECT 88
UNION SELECT 89
UNION SELECT 90
UNION SELECT 91
UNION SELECT 92
UNION SELECT 93
UNION SELECT 94
UNION SELECT 95
UNION SELECT 96
UNION SELECT 97
UNION SELECT 98
UNION SELECT 99
UNION SELECT 100
UNION SELECT 101
UNION SELECT 102
UNION SELECT 103
UNION SELECT 104
UNION SELECT 105
UNION SELECT 106
UNION SELECT 107
UNION SELECT 108
UNION SELECT 109
UNION SELECT 110
UNION SELECT 111
UNION SELECT 112
UNION SELECT 113
UNION SELECT 114
UNION SELECT 115
UNION SELECT 116
UNION SELECT 117
UNION SELECT 118
UNION SELECT 119
UNION SELECT 120
UNION SELECT 121
UNION SELECT 122
UNION SELECT 123
UNION SELECT 124
UNION SELECT 125
UNION SELECT 126
UNION SELECT 127
UNION SELECT 128
UNION SELECT 129
UNION SELECT 130
UNION SELECT 131
UNION SELECT 132
UNION SELECT 133
UNION SELECT 134
UNION SELECT 135
UNION SELECT 136
UNION SELECT 137
UNION SELECT 138
UNION SELECT 139
UNION SELECT 140
UNION SELECT 141
UNION SELECT 142
UNION SELECT 143
UNION SELECT 144
UNION SELECT 145
UNION SELECT 146
UNION SELECT 147
UNION SELECT 148
UNION SELECT 149
UNION SELECT 150
UNION SELECT 151
UNION SELECT 152
UNION SELECT 153
UNION SELECT 154
UNION SELECT 155
UNION SELECT 156
UNION SELECT 157
UNION SELECT 158
UNION SELECT 159
UNION SELECT 160
UNION SELECT 161
UNION SELECT 162
UNION SELECT 163
UNION SELECT 164
UNION SELECT 165
UNION SELECT 166
UNION SELECT 167
UNION SELECT 168
UNION SELECT 169
UNION SELECT 170
UNION SELECT 171
UNION SELECT 172
UNION SELECT 173
UNION SELECT 174
UNION SELECT 175
UNION SELECT 176
UNION SELECT 177
UNION SELECT 178
UNION SELECT 179
UNION SELECT 180
UNION SELECT 181
UNION SELECT 182
UNION SELECT 183
UNION SELECT 184
UNION SELECT 185
UNION SELECT 186
UNION SELECT 187
UNION SELECT 188
UNION SELECT 189
UNION SELECT 190
UNION SELECT 191
UNION SELECT 192
UNION SELECT 193
UNION SELECT 194
UNION SELECT 195
UNION SELECT 196
UNION SELECT 197
UNION SELECT 198
UNION SELECT 199
UNION SELECT 200
UNION SELECT 201
UNION SELECT 202
UNION SELECT 203
UNION SELECT 204
UNION SELECT 205
UNION SELECT 206
UNION SELECT 207
UNION SELECT 208
UNION SELECT 209
UNION SELECT 210
UNION SELECT 211
UNION SELECT 212
UNION SELECT 213
UNION SELECT 214
UNION SELECT 215
UNION SELECT 216
UNION SELECT 217
UNION SELECT 218
UNION SELECT 219
UNION SELECT 220
UNION SELECT 221
UNION SELECT 222
UNION SELECT 223
UNION SELECT 224
UNION SELECT 225
UNION SELECT 226
UNION SELECT 227
UNION SELECT 228
UNION SELECT 229
UNION SELECT 230
UNION SELECT 231
UNION SELECT 232
UNION SELECT 233
UNION SELECT 234
UNION SELECT 235
UNION SELECT 236
UNION SELECT 237
UNION SELECT 238
UNION SELECT 239
UNION SELECT 240
UNION SELECT 241
UNION SELECT 242
UNION SELECT 243
UNION SELECT 244
UNION SELECT 245
UNION SELECT 246
UNION SELECT 247
UNION SELECT 248
UNION SELECT 249
UNION SELECT 250
UNION SELECT 251
UNION SELECT 252
UNION SELECT 253
UNION SELECT 254
UNION SELECT 255
UNION SELECT 256
UNION SELECT 257
UNION SELECT 258
UNION SELECT 259
UNION SELECT 260
UNION SELECT 261
UNION SELECT 262
UNION SELECT 263
UNION SELECT 264
UNION SELECT 265
UNION SELECT 266
UNION SELECT 267
UNION SELECT 268
UNION SELECT 269
UNION SELECT 270
UNION SELECT 271
UNION SELECT 272
UNION SELECT 273
UNION SELECT 274
UNION SELECT 275
UNION SELECT 276
UNION SELECT 277
UNION SELECT 278
UNION SELECT 279
UNION SELECT 280
UNION SELECT 281
UNION SELECT 282
UNION SELECT 283
UNION SELECT 284
UNION SELECT 285
UNION SELECT 286
UNION SELECT 287
UNION SELECT 288
UNION SELECT 289
UNION SELECT 290
UNION SELECT 291
UNION SELECT 292
UNION SELECT 293
UNION SELECT 294
UNION SELECT 295
UNION SELECT 296
UNION SELECT 297
UNION SELECT 298
UNION SELECT 299
UNION SELECT 300
UNION SELECT 301
UNION SELECT 302
UNION SELECT 303
UNION SELECT 304
UNION SELECT 305
UNION SELECT 306
UNION SELECT 307
UNION SELECT 308
UNION SELECT 309
UNION SELECT 310
UNION SELECT 311
UNION SELECT 312
UNION SELECT 313
UNION SELECT 314
UNION SELECT 315
UNION SELECT 316
UNION SELECT 317
UNION SELECT 318
UNION SELECT 319
UNION SELECT 320
UNION SELECT 321
UNION SELECT 322
UNION SELECT 323
UNION SELECT 324
UNION SELECT 325
UNION SELECT 326
UNION SELECT 327
UNION SELECT 328
UNION SELECT 329
UNION SELECT 330
UNION SELECT 331
UNION SELECT 332
UNION SELECT 333
UNION SELECT 334
UNION SELECT 335
UNION SELECT 336
UNION SELECT 337
UNION SELECT 338
UNION SELECT 339
UNION SELECT 340
UNION SELECT 341
UNION SELECT 342
UNION SELECT 343
UNION SELECT 344
UNION SELECT 345
UNION SELECT 346
UNION SELECT 347
UNION SELECT 348
UNION SELECT 349
UNION SELECT 350
UNION SELECT 351
UNION SELECT 352
UNION SELECT 353
UNION SELECT 354
UNION SELECT 355
UNION SELECT 356
UNION SELECT 357
UNION SELECT 358
UNION SELECT 359
UNION SELECT 360
UNION SELECT 361
UNION SELECT 362
UNION SELECT 363
UNION SELECT 364
UNION SELECT 365
UNION SELECT 366
UNION SELECT 367
UNION SELECT 368
UNION SELECT 369
UNION SELECT 370
UNION SELECT 371
UNION SELECT 372
UNION SELECT 373
UNION SELECT 374
UNION SELECT 375
UNION SELECT 376
UNION SELECT 377
UNION SELECT 378
UNION SELECT 379
UNION SELECT 380
UNION SELECT 381
UNION SELECT 382
UNION SELECT 383
UNION SELECT 384
UNION SELECT 385
UNION SELECT 386
UNION SELECT 387
UNION SELECT 388
UNION SELECT 389
UNION SELECT 390
UNION SELECT 391
UNION SELECT 392
UNION SELECT 393
UNION SELECT 394
UNION SELECT 395
UNION SELECT 396
UNION SELECT 397
UNION SELECT 398
UNION SELECT 399
UNION SELECT 400
UNION SELECT 401
UNION SELECT 402
UNION SELECT 403
UNION SELECT 404
UNION SELECT 405
UNION SELECT 406
UNION SELECT 407
UNION SELECT 408
UNION SELECT 409
UNION SELECT 410
UNION SELECT 411
UNION SELECT 412
UNION SELECT 413
UNION SELECT 414
UNION SELECT 415
UNION SELECT 416
UNION SELECT 417
UNION SELECT 418
UNION SELECT 419
UNION SELECT 420
UNION SELECT 421
UNION SELECT 422
UNION SELECT 423
UNION SELECT 424
UNION SELECT 425
UNION SELECT 426
UNION SELECT 427
UNION SELECT 428
UNION SELECT 429
UNION SELECT 430
UNION SELECT 431
UNION SELECT 432
UNION SELECT 433
UNION SELECT 434
UNION SELECT 435
UNION SELECT 436
UNION SELECT 437
UNION SELECT 438
UNION SELECT 439
UNION SELECT 440
UNION SELECT 441
UNION SELECT 442
UNION SELECT 443
UNION SELECT 444
UNION SELECT 445
UNION SELECT 446
UNION SELECT 447
UNION SELECT 448
UNION SELECT 449
UNION SELECT 450
UNION SELECT 451
UNION SELECT 452
UNION SELECT 453
UNION SELECT 454
UNION SELECT 455
UNION SELECT 456
UNION SELECT 457
UNION SELECT 458
UNION SELECT 459
UNION SELECT 460
UNION SELECT 461
UNION SELECT 462
UNION SELECT 463
UNION SELECT 464
UNION SELECT 465
UNION SELECT 466
UNION SELECT 467
UNION SELECT 468
UNION SELECT 469
UNION SELECT 470
UNION SELECT 471
UNION SELECT 472
UNION SELECT 473
UNION SELECT 474
UNION SELECT 475
UNION SELECT 476
UNION SELECT 477
UNION SELECT 478
UNION SELECT 479
UNION SELECT 480
UNION SELECT 481
UNION SELECT 482
UNION SELECT 483
UNION SELECT 484
UNION SELECT 485
UNION SELECT 486
UNION SELECT 487
UNION SELECT 488
UNION SELECT 489
UNION SELECT 490
UNION SELECT 491
UNION SELECT 492
UNION SELECT 493
UNION SELECT 494
UNION SELECT 495
UNION SELECT 496
UNION SELECT 497
UNION SELECT 498
UNION SELECT 499
UNION SELECT 500
UNION SELECT 501
UNION SELECT 502
UNION SELECT 503
UNION SELECT 504
UNION SELECT 505
UNION SELECT 506
UNION SELECT 507
UNION SELECT 508
UNION SELECT 509
UNION SELECT 510
UNION SELECT 511
UNION SELECT 512
UNION SELECT 513
UNION SELECT 514
UNION SELECT 515
UNION SELECT 516
UNION SELECT 517
UNION SELECT 518
UNION SELECT 519
UNION SELECT 520
UNION SELECT 521
UNION SELECT 522
UNION SELECT 523
UNION SELECT 524
UNION SELECT 525
UNION SELECT 526
UNION SELECT 527
UNION SELECT 528
UNION SELECT 529
UNION SELECT 530
UNION SELECT 531
UNION SELECT 532
UNION SELECT 533
UNION SELECT 534
UNION SELECT 535
UNION SELECT 536
UNION SELECT 537
UNION SELECT 538
UNION SELECT 539
UNION SELECT 540
UNION SELECT 541
UNION SELECT 542
UNION SELECT 543
UNION SELECT 544
UNION SELECT 545
UNION SELECT 546
UNION SELECT 547
UNION SELECT 548
UNION SELECT 549
UNION SELECT 550
UNION SELECT 551
UNION SELECT 552
UNION SELECT 553
UNION SELECT 554
UNION SELECT 555
UNION SELECT 556
UNION SELECT 557
UNION SELECT 558
UNION SELECT 559
UNION SELECT 560
UNION SELECT 561
UNION SELECT 562
UNION SELECT 563
UNION SELECT 564
UNION SELECT 565
UNION SELECT 566
UNION SELECT 567
UNION SELECT 568
UNION SELECT 569
UNION SELECT 570
UNION SELECT 571
UNION SELECT 572
UNION SELECT 573
UNION SELECT 574
UNION SELECT 575
UNION SELECT 576
UNION SELECT 577
UNION SELECT 578
UNION SELECT 579
UNION SELECT 580
UNION SELECT 581
UNION SELECT 582
UNION SELECT 583
UNION SELECT 584
UNION SELECT 585
UNION SELECT 586
UNION SELECT 587
UNION SELECT 588
UNION SELECT 589
UNION SELECT 590
UNION SELECT 591
UNION SELECT 592
UNION SELECT 593
UNION SELECT 594
UNION SELECT 595
UNION SELECT 596
UNION SELECT 597
UNION SELECT 598
UNION SELECT 599
UNION SELECT 600
UNION SELECT 601
UNION SELECT 602
UNION SELECT 603
UNION SELECT 604
UNION SELECT 605
UNION SELECT 606
UNION SELECT 607
UNION SELECT 608
UNION SELECT 609
UNION SELECT 610
UNION SELECT 611
UNION SELECT 612
UNION SELECT 613
UNION SELECT 614
UNION SELECT 615
UNION SELECT 616
UNION SELECT 617
UNION SELECT 618
UNION SELECT 619
UNION SELECT 620
UNION SELECT 621
UNION SELECT 622
UNION SELECT 623
UNION SELECT 624
UNION SELECT 625
UNION SELECT 626
UNION SELECT 627
UNION SELECT 628
UNION SELECT 629
UNION SELECT 630
UNION SELECT 631
UNION SELECT 632
UNION SELECT 633
UNION SELECT 634
UNION SELECT 635
UNION SELECT 636
UNION SELECT 637
UNION SELECT 638
UNION SELECT 639
UNION SELECT 640
UNION SELECT 641
UNION SELECT 642
UNION SELECT 643
UNION SELECT 644
UNION SELECT 645
UNION SELECT 646
UNION SELECT 647
UNION SELECT 648
UNION SELECT 649
UNION SELECT 650
UNION SELECT 651
UNION SELECT 652
UNION SELECT 653
UNION SELECT 654
UNION SELECT 655
UNION SELECT 656
UNION SELECT 657
UNION SELECT 658
UNION SELECT 659
UNION SELECT 660
UNION SELECT 661
UNION SELECT 662
UNION SELECT 663
UNION SELECT 664
UNION SELECT 665
UNION SELECT 666
UNION SELECT 667
UNION SELECT 668
UNION SELECT 669
UNION SELECT 670
UNION SELECT 671
UNION SELECT 672
UNION SELECT 673
UNION SELECT 674
UNION SELECT 675
UNION SELECT 676
UNION SELECT 677
UNION SELECT 678
UNION SELECT 679
UNION SELECT 680
UNION SELECT 681
UNION SELECT 682
UNION SELECT 683
UNION SELECT 684
UNION SELECT 685
UNION SELECT 686
UNION SELECT 687
UNION SELECT 688
UNION SELECT 689
UNION SELECT 690
UNION SELECT 691
UNION SELECT 692
UNION SELECT 693
UNION SELECT 694
UNION SELECT 695
UNION SELECT 696
UNION SELECT 697
UNION SELECT 698
UNION SELECT 699
UNION SELECT 700
UNION SELECT 701
UNION SELECT 702
UNION SELECT 703
UNION SELECT 704
UNION SELECT 705
UNION SELECT 706
UNION SELECT 707
UNION SELECT 708
UNION SELECT 709
UNION SELECT 710
UNION SELECT 711
UNION SELECT 712
UNION SELECT 713
UNION SELECT 714
UNION SELECT 715
UNION SELECT 716
UNION SELECT 717
UNION SELECT 718
UNION SELECT 719
UNION SELECT 720
UNION SELECT 721
UNION SELECT 722
UNION SELECT 723
UNION SELECT 724
UNION SELECT 725
UNION SELECT 726
UNION SELECT 727
UNION SELECT 728
UNION SELECT 729
UNION SELECT 730
UNION SELECT 731
UNION SELECT 732
UNION SELECT 733
UNION SELECT 734
UNION SELECT 735
UNION SELECT 736
UNION SELECT 737
UNION SELECT 738
UNION SELECT 739
UNION SELECT 740
UNION SELECT 741
UNION SELECT 742
UNION SELECT 743
UNION SELECT 744
UNION SELECT 745
UNION SELECT 746
UNION SELECT 747
UNION SELECT 748
UNION SELECT 749
UNION SELECT 750
UNION SELECT 751
UNION SELECT 752
UNION SELECT 753
UNION SELECT 754
UNION SELECT 755
UNION SELECT 756
UNION SELECT 757
UNION SELECT 758
UNION SELECT 759
UNION SELECT 760
UNION SELECT 761
UNION SELECT 762
UNION SELECT 763
UNION SELECT 764
UNION SELECT 765
UNION SELECT 766
UNION SELECT 767
UNION SELECT 768
UNION SELECT 769
UNION SELECT 770
UNION SELECT 771
UNION SELECT 772
UNION SELECT 773
UNION SELECT 774
UNION SELECT 775
UNION SELECT 776
UNION SELECT 777
UNION SELECT 778
UNION SELECT 779
UNION SELECT 780
UNION SELECT 781
UNION SELECT 782
UNION SELECT 783
UNION SELECT 784
UNION SELECT 785
UNION SELECT 786
UNION SELECT 787
UNION SELECT 788
UNION SELECT 789
UNION SELECT 790
UNION SELECT 791
UNION SELECT 792
UNION SELECT 793
UNION SELECT 794
UNION SELECT 795
UNION SELECT 796
UNION SELECT 797
UNION SELECT 798
UNION SELECT 799
UNION SELECT 800
UNION SELECT 801
UNION SELECT 802
UNION SELECT 803
UNION SELECT 804
UNION SELECT 805
UNION SELECT 806
UNION SELECT 807
UNION SELECT 808
UNION SELECT 809
UNION SELECT 810
UNION SELECT 811
UNION SELECT 812
UNION SELECT 813
UNION SELECT 814
UNION SELECT 815
UNION SELECT 816
UNION SELECT 817
UNION SELECT 818
UNION SELECT 819
UNION SELECT 820
UNION SELECT 821
UNION SELECT 822
UNION SELECT 823
UNION SELECT 824
UNION SELECT 825
UNION SELECT 826
UNION SELECT 827
UNION SELECT 828
UNION SELECT 829
UNION SELECT 830
UNION SELECT 831
UNION SELECT 832
UNION SELECT 833
UNION SELECT 834
UNION SELECT 835
UNION SELECT 836
UNION SELECT 837
UNION SELECT 838
UNION SELECT 839
UNION SELECT 840
UNION SELECT 841
UNION SELECT 842
UNION SELECT 843
UNION SELECT 844
UNION SELECT 845
UNION SELECT 846
UNION SELECT 847
UNION SELECT 848
UNION SELECT 849
UNION SELECT 850
UNION SELECT 851
UNION SELECT 852
UNION SELECT 853
UNION SELECT 854
UNION SELECT 855
UNION SELECT 856
UNION SELECT 857
UNION SELECT 858
UNION SELECT 859
UNION SELECT 860
UNION SELECT 861
UNION SELECT 862
UNION SELECT 863
UNION SELECT 864
UNION SELECT 865
UNION SELECT 866
UNION SELECT 867
UNION SELECT 868
UNION SELECT 869
UNION SELECT 870
UNION SELECT 871
UNION SELECT 872
UNION SELECT 873
UNION SELECT 874
UNION SELECT 875
UNION SELECT 876
UNION SELECT 877
UNION SELECT 878
UNION SELECT 879
UNION SELECT 880
UNION SELECT 881
UNION SELECT 882
UNION SELECT 883
UNION SELECT 884
UNION SELECT 885
UNION SELECT 886
UNION SELECT 887
UNION SELECT 888
UNION SELECT 889
UNION SELECT 890
UNION SELECT 891
UNION SELECT 892
UNION SELECT 893
UNION SELECT 894
UNION SELECT 895
UNION SELECT 896
UNION SELECT 897
UNION SELECT 898
UNION SELECT 899
UNION SELECT 900
UNION SELECT 901
UNION SELECT 902
UNION SELECT 903
UNION SELECT 904
UNION SELECT 905
UNION SELECT 906
UNION SELECT 907
UNION SELECT 908
UNION SELECT 909
UNION SELECT 910
UNION SELECT 911
UNION SELECT 912
UNION SELECT 913
UNION SELECT 914
UNION SELECT 915
UNION SELECT 916
UNION SELECT 917
UNION SELECT 918
UNION SELECT 919
UNION SELECT 920
UNION SELECT 921
UNION SELECT 922
UNION SELECT 923
UNION SELECT 924
UNION SELECT 925
UNION SELECT 926
UNION SELECT 927
UNION SELECT 928
UNION SELECT 929
UNION SELECT 930
UNION SELECT 931
UNION SELECT 932
UNION SELECT 933
UNION SELECT 934
UNION SELECT 935
UNION SELECT 936
UNION SELECT 937
UNION SELECT 938
UNION SELECT 939
UNION SELECT 940
UNION SELECT 941
UNION SELECT 942
UNION SELECT 943
UNION SELECT 944
UNION SELECT 945
UNION SELECT 946
UNION SELECT 947
UNION SELECT 948
UNION SELECT 949
UNION SELECT 950
UNION SELECT 951
UNION SELECT 952
UNION SELECT 953
UNION SELECT 954
UNION SELECT 955
UNION SELECT 956
UNION SELECT 957
UNION SELECT 958
UNION SELECT 959
UNION SELECT 960
UNION SELECT 961
UNION SELECT 962
UNION SELECT 963
UNION SELECT 964
UNION SELECT 965
UNION SELECT 966
UNION SELECT 967
UNION SELECT 968
UNION SELECT 969
UNION SELECT 970
UNION SELECT 971
UNION SELECT 972
UNION SELECT 973
UNION SELECT 974
UNION SELECT 975
UNION SELECT 976
UNION SELECT 977
UNION SELECT 978
UNION SELECT 979
UNION SELECT 980
UNION SELECT 981
UNION SELECT 982
UNION SELECT 983
UNION SELECT 984
UNION SELECT 985
UNION SELECT 986
UNION SELECT 987
UNION SELECT 988
UNION SELECT 989
UNION SELECT 990
UNION SELECT 991
UNION SELECT 992
UNION SELECT 993
UNION SELECT 994
UNION SELECT 995
UNION SELECT 996
UNION SELECT 997
UNION SELECT 998
UNION SELECT 999
UNION SELECT 1000
) n
ORDER BY x.`Date:Date:75` ASC, x.`Serial No:Link/Serial No:150` ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment