小编use*_*er7的帖子

如何使用SQL查询从表中删除重复项

我有一张表如下:

emp_name   emp_address  sex  matial_status  
uuuu       eee          m    s
iiii       iii          f    s
uuuu       eee          m    s
Run Code Online (Sandbox Code Playgroud)

我想基于3个字段emp_name,emp_address和sex删除重复的条目.我的结果表(在删除重复之后)应该看起来像 -

emp_name    emp_address   sex   marital_status
uuuu        eee           m     s
iiii        iii           f     s
Run Code Online (Sandbox Code Playgroud)

我无法回想起如何为此编写SQL查询.有人帮忙吗?

sql t-sql

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

交叉和两个字符串的并集

我必须消除字符串1中出现的字符串2,并找到两个字符串的交集.

这是我尝试过的:

#include "stdafx.h"
#include "stdio.h"
#include "conio.h"
#include "string.h"

class operation
{
public:
    char string1[100];
    char string2[50];


    operation(){};
    operation(char a[100], char b[50]);
    operation operator+(operation);
    operation operator-(operation);
    operation operator*(operation);
};

operation::operation(char a[100], char b[50])
{
    strcpy(string1, a);
    strcpy(string2, b);
}

operation operation::operator +(operation param)
{
    operation temp;
    strcpy(param.string1, temp.string1);
    strcpy(param.string2, temp.string2);
    strcat(temp.string1, temp.string2);
    return (temp);
}

operation operation::operator -(operation param)
{
    operation temp;
    strcpy(param.string1, temp.string1);
    strcpy(param.string2, temp.string2) ;
    for (int i = 0; i<strlen(temp.string2); i++)
    {
        temp.string1.erase(i, 1);
    }
    return …
Run Code Online (Sandbox Code Playgroud)

c++

3
推荐指数
2
解决办法
6328
查看次数

标签 统计

c++ ×1

sql ×1

t-sql ×1