Home > database >  Excuse me a table for six fields, each field is random values from the same collection, query how ca
Excuse me a table for six fields, each field is random values from the same collection, query how ca

Time:10-03

For example, a table with six out of the primary key columns, each line each column to take a number from 1 to 100 (don't repeat.) table is as follows:
Id element1 element2 element3 element4 element5 element6
1, 50, 60, 70, 80, 90, 91
2 30 to 40 to 50 52 to 56 70
3 to 10 20 30 to 40 to 50 60
If I want to query the 50 rows, should return line is 1, 2, 3.
50; seven rows, if I want to query should return is line 1, 2,
If I want to check have 56 line, should return to line 2.
How can I query?
Hope to have a great god give answer, thank you very much.

CodePudding user response:

Select *
The from TB
Where concat (element1 element2 element3, element4, element5, element6) like '% 50% 70%'

CodePudding user response:

Where in 50 (, element1 element2 element3, element4, element5, element6)

CodePudding user response:


Junction post rate: 0%

When you the solutions of the problems please post.
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html

8, how to give points and knot stick?
http://bbs.csdn.net/help#post_dispose

CodePudding user response:

Complement to describe,
Database tables should it may be so,
MySQL query, for example, a table with six out of the primary key columns, each line each column to take a number from 1 to 100 (don't repeat.) table is as follows:
Id element1 element2 element3 element4 element5 element6
1, 50, 60, 70, 80, 90, 91
2 70 56 52 50 40 30
3 60 50 30 40 20 10
If I want to query the 50 rows, should return line is 1, 2, 3.
50; seven rows, if I want to query should return is line 1, 2,
If I want to check have 56 line, should return to line 2.
.

CodePudding user response:

refer to the second floor ZJCXC response:
50 in the where (, element1 element2 element3, element4, element5, element6)

If the query multiple worth???

CodePudding user response:

reference 1st floor rucypli response:
select *
The from TB
Where concat (element1 element2 element3, element4, element5, element6) like '% 50% 70%


I'm just not ready to describe, complement to describe,
Database tables should it may be so, the value of each field disorder.
MySQL query, for example, a table with six out of the primary key columns, each line each column to take a number from 1 to 100 (don't repeat.) table is as follows:
Id element1 element2 element3 element4 element5 element6
1, 50, 60, 70, 80, 90, 91
2 70 56 52 50 40 30
3 60 50 30 40 20 10
If I want to query the 50 rows, should return line is 1, 2, 3.
50; seven rows, if I want to query should return is line 1, 2,
If I want to check have 56 line, should return to line 2.

CodePudding user response:

Each value corresponding to an in, multiple values meet the use and at the same time, any one meet with or
  • Related