Use Mimer Validator to check SQL queries

Source: Internet
Author: User

Q: assume that one of my tables contains (a, B, c, d) and (a, B) to form a key combination. Can I write this query in the column value? For example:
Copy codeThe Code is as follows:
Select a, c, d from mytable
Where (a, B) in (1, 2), (1, 4), (1, 5 ))

A: Yes.
If you suspect that some SQL architectures are valid, run Mimer Validator. In this case, your query (the query you log on to the validator) will get the following results:
* In SQL-92, invalid
* Valid in SQL-99 and SQL _2003 with the following comments:
F641, "Row and table constructors"
T051, "Row types"
F561, "Full value expressions"
The following features or Core SQL-99 (draft) outside of the Core SQL-200x will be used ):
F641, "Row and table constructors"
T051, "Row types"
F561, "Full value expressions"
That is to say, if your special database system does not support those selection features, you will still receive an error message.
You may want to try the following query:
SELECT a, c, d
FROM mytable
WHERE a = 1 AND B = 2
OR a = 1 AND B = 4
OR a = 1 AND B = 5
This query runs very smoothly, because (a, B) is a key, so index query is more effective.

Related Article

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.