我试图从以下输出:
select count(r.id) and count(r.key) from rules r where lower(r.name) in ('xss attack','dos attack') ;
但是收到错误
ORA-00923:未找到FROM关键字
答案 0 :(得分:2)
这样的东西? :
@IBAction func saveButton(_ sender: Any)
{
addRestaurant()
}
func addRestaurant()
{
ref = FIRDatabase.database().reference().child("restaurants")
let key = ref?.childByAutoId().key
let name = addName.text
let phone = addPhone.text
ref?.child(key!).setValue(["name": name, "phone": phone])
}
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any])
{
let image = info[UIImagePickerControllerOriginalImage] as? UIImage
addImage.image = image
var data = Data()
data = UIImagePNGRepresentation(image!)!
let uniqueName = NSUUID().uuidString
let imageRef = FIRStorage.storage().reference().child("restaurantImage").child("\(uniqueName)")
imageRef.put(data, metadata: nil).observe(.success){(snapshot) in
let downloadURL = snapshot.metadata?.downloadURL()?.absoluteString
let imageDBRef = FIRDatabase.database().reference().child("restaurants/image")
let key = imageDBRef.childByAutoId().key
imageDBRef.child(key).setValue(downloadURL)
}
self.dismiss(animated: true, completion: nil)
}
答案 1 :(得分:0)
我尝试了下面的解决方案:
select (select count(r.id) from rules r where lower(r.name) in ('xss attack','dos attack')) AS name,(select count(r.key) from rules r where lower(r.name) in ('xss attack','dos attack')) AS name from rules;
如果上述查询需要改进,请纠正我。
输出I'得到就像
NAME NAME
2 2
2 2
虽然我希望我的输出应该像
一样NAME NAME
2 2