Home > database > Mysql screening such record operation
Mysql screening such record operation
Time:10-13
Hello, is there a table, 100000 data, to query the qualified, but because the data is too big, can't verify whether accurate, but I use in my condition, a new table, the data content basic tables, but according to the previous query result is wrong!
Above is a table of contents, of course I have a id number in the table it can add a id field I want the result is that Find duplicate records, but " zhang SAN is not in conformity with the ", as long as in the KT field "opened" whether a few records even if success! I want the result is the bill, fifty and KT is "N" not seen "open" to find out! Would, of course, also there is a single "N" is also a need to look out! SELECT * FROM the peo WHERE (id, people_no, people_name) IN (SELECT id, people_no, people_name FROM the peo WHERE kt="\ \ N" GROUP BY people_no, people_name HAVING the COUNT (*) & gt;=1); Thank you for your attention!
CodePudding user response:
You want is this effect
My SQL is wrote
Select * from Sid (select a. *, b.i d The from the peo a Left the join (select * from the peo where peo. Kt='open') on Amy polumbo eople_no b=p. eople_no and Amy polumbo eople_name=p. eople_name) A GROUP BY Amy polumbo eople_no, Amy polumbo eople_name having a.s id is null
CodePudding user response:
Yes, thank you very much !
CodePudding user response:
How to add a column sid? What is your idea, please?