| |

VerySource

 Forgot password?
 Register
Search
Author: catchu

Ask the heroes, can such a query be realized? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

[Copy link]

1

Threads

8

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-6-25 09:00:01
| Show all posts
The data types of columns A and B are both char
Reply

Use magic Report

1

Threads

8

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-6-25 11:45:01
| Show all posts
haigerrual


   
Cuddling requirements
The first floor can be achieved

--------------------
The statement on the first floor is too strong to be applicable. I mean there are many records like column A 0002 and column B 10. It is possible that column A is 12345 and column B is 08
Reply

Use magic Report

1

Threads

8

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-6-25 15:15:02
| Show all posts
Why are they all stuck together? ? ? Resend it again
Table I
Column A Column B
0001 1
0001 2
0001 3
0001 4
0001 5
0001 6
0001 7
0001 8
0001 9
0001 10
0001 11
0001 12
0002 10
0003 1
0003 2
0003 3
0003 4
0003 5
0003 6
0003 7
0003 8
0003 9
0003 10
0003 11
0003 12
----------
Reply

Use magic Report

0

Threads

35

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-6-25 20:45:02
| Show all posts
Still don't understand what it means
Reply

Use magic Report

1

Threads

8

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-6-26 20:00:01
| Show all posts
sinexe


   Still don't understand what it means

-------------------------------------------
Catch you! ! Your statement can basically solve the problem, but how do I write if column B is not equal to 12? ? ?
Reply

Use magic Report

1

Threads

8

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-6-26 23:00:01
| Show all posts
Almost, thank you! !
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-6-27 01:45:01
| Show all posts
such?
select * from t where column A = '0002' and column B <> '12'
Reply

Use magic Report

0

Threads

35

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-6-27 06:30:01
| Show all posts
such?
select * from t where column B <> '12'
A little dizzy
Reply

Use magic Report

0

Threads

35

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-6-27 13:15:01
| Show all posts
Still like this?
select column A, min(column B) from t group by A column having count(*) = 1 and min(column B) <> '12'
Reply

Use magic Report

1

Threads

8

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-6-27 22:00:01
| Show all posts
Can be found, and finally ask another question: I now want to update column B = 12 how to write? ? ?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list