SELECT 'ColName1', 'ColName2', 'ColName3' UNION ALL SELECT ColName1, ColName2, ColName3 FROM YourTable INTO OUTFILE 'c:\\datasheet.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n'
Могло бы быть слишком старым, но здесь мое решение для быстрого
class Recursion {
func fibonacci(_ input: Int) {
var dictioner: [Int: Int] = [:]
dictioner[0] = 0
dictioner[1] = 1
print(fibonacciCal(input, dictioner: &dictioner))
}
func fibonacciCal(_ input: Int, dictioner: inout [Int: Int]) -> Int {
if let va = dictioner[input]{
return va
} else {
let firstPart = fibonacciCal(input-1, dictioner: &dictioner)
let secondPart = fibonacciCal(input-2, dictioner: &dictioner)
if dictioner[input] == nil {
dictioner[input] = firstPart+secondPart
}
return firstPart+secondPart
}
}
}
// 0,1,1,2,3,5,8
class TestRecursion {
func testRecursion () {
let t = Recursion()
t.fibonacci(3)
}
}