小编A h*_*ing的帖子

mysql - 如果null超过特定数量,则删除行

我有一张桌子:

id | name1 | name2 | name3
 1 |  asa  |  NULL |  das
 2 |  NULL |  NULL |  asas

我想删除有两次或多次NULL值的每一行(这里,id为2的
那个)我已经用一个小的PHP脚本做了但我不知道是否可以用mysql查询完成

我是mysql的新手,所以我还没有尝试过任何东西!

mysql

5
推荐指数
1
解决办法
1万
查看次数

使用指针通过单词反转字符串

我的程序在下面反转一个字符串,而不是通过字符而不是字.

示例输入 Hello Mello Sanple输出 Hello Mello Hello

我不知道我从哪里得到第一个Hello.

#include "stdafx.h"
#include <iostream>

int main(int argc, char **argv)
{
  char input[255];
  char *head; // head of a word.
  char *tail; // tail of a word.

  printf("Enter a sentence: ");
  gets_s(input); // read a whole line.
  tail = input + strlen(input) - 1;

  while (tail >= input) 
    {
      if (*tail == 0 || *tail == ' ') 
        {
          tail--; // move to the tail of a word.
        }
      else 
        {
          tail[1] …
Run Code Online (Sandbox Code Playgroud)

c++ pointers

0
推荐指数
1
解决办法
134
查看次数

标签 统计

c++ ×1

mysql ×1

pointers ×1