首页 > 解决方案 > 数据库选择mysql有问题

问题描述

我有这张桌子table chatstbl_suggested。在桌上聊天我有

  id       questions         answer            date
  1        What is life                        2020-02-08   
  2        what is PC      personal computer   2020-02-08
  3        What is life uk   good              2020-02-08
  4        where is the cr   there             2020-02-08

tbl_suggest我有这个

      id       chats_id      questions                      
      1            1          What is life in spain         
      2            1         what is liefe in uk               
      3            1          What is life  in paris   

我查询这段代码

SELECT chats.id,chats.question,chats.answer,tbl_suggest.questions,chats.date 
from chats LEFT JOIN tbl_suggest on chats.id= tbl_suggest.chats_id O
RDER by chats.date ASC

结果是,然后我想删除第二排和第三排的两个生活问题

chat.id chat.questions    chat.answer     tbl_suggest.question     chats.date
  1      what is life                     what is life in spain       2020-02-08
  1      what is life                     what is liefe in uk         2020-02-08
  1      what is life                     what is life in paris       2020-02-08
  2      what is PC       personal computer                           2020-02-08       
  3       What is life uk  good                                        2020-02-08
  4      where is the cr   there                                      2020-02-08

我想要的是删除这样的生命多余的东西

   chat.questions        chat.answer     tbl_suggest.question       chats.date
   what is life                          what is life in spain       2020-02-08
                                          what is liefe in uk         2020-02-08
                                         what is life in paris       2020-02-08
   what is PC          personal computer                             2020-02-08       
   What is life uk      good                                         2020-02-08
   where is the cr       there                                      2020-02-08

在我的对话框中正确显示

标签: mysql

解决方案


推荐阅读