我需要帮助连接两个表。
下面是数据设置
private func setupConstraints(){
//topView is a simple UIView with a red background for example purposes
view.addSubview(topView)
topView.translatesAutoresizingMaskIntoConstraints = false
let cn1 = NSLayoutConstraint(item: topView, attribute: .leading, relatedBy: .equal, toItem: self.view, attribute: .leading, multiplier: 1.0, constant: 0)
//Menu bar trailing end is 20 px from right edge of the screen
let cn2 = NSLayoutConstraint(item: topView, attribute: .trailing, relatedBy: .equal, toItem: self.view, attribute: .trailing, multiplier: 1.0, constant: 0)
//Menu bar height = constant 60
let cn3 = NSLayoutConstraint(item: topView, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 50)
//Menu bar width greater than or equal to 400
let cn4 = NSLayoutConstraint(item: topView, attribute: .width, relatedBy: .greaterThanOrEqual, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 400)
//Menu bar vertical padding from the top edge of the screen = 20
let cn5 = NSLayoutConstraint(item: topView, attribute: .top, relatedBy: .equal, toItem: self.view, attribute: .top, multiplier: 1.0, constant: 50)
view.addConstraint(cn1)
view.addConstraint(cn2)
view.addConstraint(cn3)
view.addConstraint(cn4)
view.addConstraint(cn5)
}
因此可以对表2中的booking_id列的尾部空格进行裁剪,并可以与表1合并
我要实现的是这样:
Table 1 :
booking_id(PK) | name
TTTxxxyy passenger 1
TTTerwer passenger 2
Table 2 : here the booking_id key has extra 3 trailing blank spaces
with its values.( bcoz of the requirement)
booking_id(PK) | amount
TTTxxxyy 50000
TTTerwer 70000