The query instance in MySQL does not contain all 3 fields in a table

Source: Internet
Author: User

You need to query three fields for information about the existence of the tables in all the libraries under an instance, and the end of the surface does not include the _ number information.



SELECT Table_schema,table_name,sum (case "column_name in" (' User ', ' host ', ' password ') then 1 else 0 end) flag from infor Mation_schema. ' COLUMNS ' a

WHERE table_schema= ' MySQL '

GROUP BY Table_schema,table_name have flag>0;



The results are shown below

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/71/4b/wkiol1xk-vlyupgqaae-akb4km0242.jpg "title=" 20150812_1.png "alt=" Wkiol1xk-vlyupgqaae-akb4km0242.jpg "/>


The flag represents the number of three fields.



This article from "Cloud Light Breeze Light" blog, declined reprint!

The query instance in MySQL does not contain all 3 fields in a table

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.