如果结果有条件,则事件调度程序会计算在内

时间:2018-09-12 03:14:25

标签: php mysql events triggers scheduler

我有以下查询,如果计数为1,我想更新数据库。我已经在事件调度程序mysql中创建了所有此事件。但是有些问题我无法确定。如果可能的话,请帮助我,查询如下:

91.52%

enter image description here

出价价格应该唯一地更新活动时间表中的表格

我想在事件调度程序中发生这种情况。我在事件调度程序中所做的想法如下:

87.28%

END | 分隔符;

应该从预期的输出中获取具有唯一计数即1的查询的用户ID,并更新产品表并将获胜者设置为该用户ID。

enter image description here

1 个答案:

答案 0 :(得分:0)

您需要<?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/listLayout" android:layout_width="wrap_content" android:layout_height="248dp" android:layout_marginEnd="4dp" android:layout_marginStart="4dp" android:layout_marginTop="4dp" tools:context="com.vijer.test1.MainActivity"> <!-- First Group --> <View android:id="@+id/group_one" android:layout_width="match_parent" android:layout_height="80dp" android:background="@android:color/darker_gray" app:layout_constraintLeft_creator="@id/listLayout" app:layout_constraintTop_creator="@id/listLayout" /> <ImageView android:id="@+id/album_art1" android:layout_width="80dp" android:layout_height="80dp" android:contentDescription="@string/image_description" android:src="@drawable/image1" app:layout_constraintLeft_creator="@id/listLayout" app:layout_constraintTop_toTopOf="@id/listLayout" /> <View android:layout_width="match_parent" android:layout_height="match_parent" app:layout_constraintEnd_toEndOf="parent" /> <TextView android:id="@+id/meta_artist1" android:layout_width="match_parent" android:layout_height="wrap_content" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="18sp" android:textStyle="bold" app:layout_constraintLeft_toRightOf="@id/album_art1" app:layout_constraintTop_toTopOf="@id/listLayout" tools:text="@string/tag_artist1" /> <TextView android:id="@+id/meta_title1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="18sp" android:textStyle="bold" app:layout_constraintLeft_toRightOf="@id/album_art1" app:layout_constraintTop_toBottomOf="@id/meta_artist1" tools:text="@string/tag_title1" /> <TextView android:id="@+id/meta_album1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="16sp" app:layout_constraintLeft_toRightOf="@id/album_art1" app:layout_constraintTop_toBottomOf="@id/meta_title1" tools:text="@string/tag_album1" /> <TextView android:id="@+id/meta_time1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="4dp" android:layout_marginStart="4dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="16sp" app:layout_constraintEnd_toStartOf="@+id/meta_delimiter1" app:layout_constraintTop_toBottomOf="@id/meta_title1" tools:text="@string/tag_length1" /> <TextView android:id="@+id/meta_delimiter1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="4dp" android:layout_marginStart="4dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="16sp" app:layout_constraintEnd_toStartOf="@+id/meta_file_type1" app:layout_constraintTop_toBottomOf="@id/meta_title1" tools:text="@string/tag_delimiter" /> <TextView android:id="@+id/meta_file_type1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="4dp" android:layout_marginTop="4dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="16sp" app:layout_constraintBottom_toBottomOf="@+id/meta_time1" app:layout_constraintEnd_toEndOf="@+id/listLayout" tools:text="@string/tag_file_type1" /> <!-- Second Group --> <View android:id="@+id/group_two" android:layout_width="match_parent" android:layout_height="80dp" android:layout_marginTop="4dp" android:background="@android:color/darker_gray" app:layout_constraintLeft_toLeftOf="@id/listLayout" app:layout_constraintTop_toBottomOf="@id/group_one" tools:layout_editor_absoluteX="0dp" /> <ImageView android:id="@+id/album_art2" android:layout_width="80dp" android:layout_height="80dp" android:layout_marginTop="4dp" android:contentDescription="@string/image_description" android:src="@drawable/image2" app:layout_constraintLeft_toLeftOf="@id/listLayout" app:layout_constraintTop_toBottomOf="@id/group_one" /> <View android:layout_width="match_parent" android:layout_height="match_parent" app:layout_constraintEnd_toEndOf="parent" /> <TextView android:id="@+id/meta_artist12" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="4dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="18sp" android:textStyle="bold" app:layout_constraintLeft_toRightOf="@id/album_art2" app:layout_constraintTop_toBottomOf="@id/group_one" tools:text="@string/tag_artist2" /> <TextView android:id="@+id/meta_title12" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" android:layout_marginTop="30dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="18sp" android:textStyle="bold" app:layout_constraintLeft_toRightOf="@id/album_art2" app:layout_constraintTop_toBottomOf="@id/group_one" tools:text="@string/tag_title2" /> <TextView android:id="@+id/meta_album12" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" android:layout_marginTop="56dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="16sp" app:layout_constraintLeft_toRightOf="@id/album_art2" app:layout_constraintTop_toBottomOf="@id/group_one" tools:text="@string/tag_album2" /> <TextView android:id="@+id/meta_time12" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="4dp" android:layout_marginStart="4dp" android:layout_marginTop="56dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="16sp" app:layout_constraintEnd_toStartOf="@+id/meta_delimiter12" app:layout_constraintTop_toBottomOf="@id/group_one" tools:text="@string/tag_length2" /> <TextView android:id="@+id/meta_delimiter12" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="4dp" android:layout_marginStart="4dp" android:layout_marginTop="56dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="16sp" app:layout_constraintEnd_toStartOf="@+id/meta_file_type12" app:layout_constraintTop_toBottomOf="@id/group_one" tools:text="@string/tag_delimiter" /> <TextView android:id="@+id/meta_file_type12" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="4dp" android:layout_marginTop="56dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="16sp" app:layout_constraintBottom_toBottomOf="@+id/meta_time12" app:layout_constraintEnd_toEndOf="@+id/group_one" tools:text="@string/tag_file_type2" /> <!-- Third Group --> <View android:id="@+id/group_three" android:layout_width="match_parent" android:layout_height="80dp" android:layout_marginTop="4dp" android:background="@android:color/darker_gray" app:layout_constraintLeft_toLeftOf="@id/listLayout" app:layout_constraintTop_toBottomOf="@id/group_two" /> <ImageView android:id="@+id/album_art3" android:layout_width="80dp" android:layout_height="80dp" android:layout_marginTop="4dp" android:contentDescription="@string/image_description" android:src="@drawable/image3" app:layout_constraintLeft_toLeftOf="@id/listLayout" app:layout_constraintTop_toBottomOf="@id/group_two" /> <View android:layout_width="match_parent" android:layout_height="match_parent" app:layout_constraintEnd_toEndOf="parent" /> <TextView android:id="@+id/meta_artist13" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" android:layout_marginTop="4dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="18sp" android:textStyle="bold" app:layout_constraintLeft_toRightOf="@id/album_art3" app:layout_constraintTop_toBottomOf="@id/group_two" tools:text="@string/tag_artist3" /> <TextView android:id="@+id/meta_title13" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" android:layout_marginTop="30dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="18sp" android:textStyle="bold" app:layout_constraintLeft_toRightOf="@id/album_art3" app:layout_constraintTop_toBottomOf="@id/group_two" tools:text="@string/tag_title3" /> <TextView android:id="@+id/meta_album13" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" android:layout_marginTop="56dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="16sp" app:layout_constraintLeft_toRightOf="@id/album_art3" app:layout_constraintTop_toBottomOf="@id/group_two" tools:text="@string/tag_album3" /> <TextView android:id="@+id/meta_time13" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="4dp" android:layout_marginStart="4dp" android:layout_marginTop="56dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="16sp" app:layout_constraintEnd_toStartOf="@+id/meta_delimiter13" app:layout_constraintTop_toBottomOf="@id/group_two" tools:text="@string/tag_length3" /> <TextView android:id="@+id/meta_delimiter13" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="4dp" android:layout_marginStart="4dp" android:layout_marginTop="56dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="16sp" app:layout_constraintEnd_toStartOf="@+id/meta_file_type13" app:layout_constraintTop_toBottomOf="@id/group_two" tools:text="@string/tag_delimiter" /> <TextView android:id="@+id/meta_file_type13" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="4dp" android:layout_marginTop="56dp" android:fontFamily="@font/abeezee" android:textColor="#ffffff" android:textSize="16sp" app:layout_constraintBottom_toBottomOf="@+id/meta_time13" app:layout_constraintEnd_toEndOf="@+id/group_two" tools:text="@string/tag_file_type3" /> </android.support.constraint.ConstraintLayout> 而不是ON,也需要WHERE

GROUP BY user_id