合并具有相同id mysql的列

时间:2018-02-09 22:21:22

标签: mysql

我创建了一个视图,下面的图片是它的查询:

import UIKit
import AVFoundation

class ViewController: UIViewController {

    private var player: AVQueuePlayer?
    private var playerLayer: AVPlayerLayer?

    override func viewDidLoad() {
        super.viewDidLoad()
        super.view.backgroundColor = UIColor.lightGray

        // Video file for demo
        let mediaPath = URL(fileURLWithPath:Bundle.main.path(forResource: "ChoppedBipBop", ofType: "m4v")!)

        startDemoVideo(videoURL: mediaPath)
    }

    public func startDemoVideo(videoURL: URL) {
        player = AVQueuePlayer()
        playerLayer = AVPlayerLayer(player: player)

        guard let playerLayer = playerLayer else { fatalError("Error creating player layer") }
        playerLayer.frame = view.layer.bounds
        view.layer.addSublayer(playerLayer)

        let videoAsset = AVURLAsset(url: videoURL)

        videoAsset.loadValuesAsynchronously(forKeys: ["duration", "playable"]) {

            DispatchQueue.main.async {
                let loopItem = AVPlayerItem(asset: videoAsset)
                self.player?.insert(loopItem, after: nil)

                self.player?.play()
            }
        }
    }

}

order_extended

有没有办法合并相同的products_id?像这样的东西:

select * from order_extended

这是视图定义:

+-----+----------+----------------+---------+------+------+
| pid | quantity | product_name   | Walmart | Sams | Ley  |
+-----+----------+----------------+---------+------+------+
|   1 |   1.00   | ACEITE CAPULLO | 27.50   | 24.33| 29.90|
|   3 |   2.00   | ACEITE DE AJONJ| 40.00   | null | null | 
|   5 |   2.00   | ACEITE DE COCO | 114.00  | null | null | 
+-----+----------+----------------+---------+------+------+ 

0 个答案:

没有答案