Check SQL queries with Mimer validator _oracle

Source: Internet
Author: User
Q: If my table contains (a,b,c,d) and (a,b) Form a combination of keys. Can I write this query in the column value? For example:
Copy Code code as follows:

Select A,c,d from MyTable
where (A,b) in ((1,2), (1,4), (1,5)

Answer: Yes.
If you suspect that some SQL schema is valid, run it through Mimer Validator. In this case, your query (the query you log in to the validator) will have the following results:
* in SQL-92, invalid
* In SQL-99 and sql_2003, valid and with the following comments:
F641, "Row and table constructors"
T051, "Row types"
F561, "Full value expressions"
The following features or core sql-200x (draft) are used beyond the core SQL-99:
F641, "Row and table constructors"
T051, "Row types"
F561, "Full value expressions"
This means that if your particular database system does not support those selection features, you will still receive the error message.
Perhaps you would like 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 works very well because (A,B) is a key, so it is more efficient to use an index query.

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.