SQL statements in game testing and SQL statements in game Testing

Source: Internet
Author: User

SQL statements in game testing and SQL statements in game Testing
The basic content will not be written here.
One compound condition is often used in game tests.
In the game, you usually need to check the remaining user money. For example, an energy field indicates physical strength.
Table name: db_role key field id, name (unique)
The condition to be queried is that energy is in the first gear of 1500, and the second gear is 500 ~ Between 1000
Statement is
Select id, name, energy from db_name whereenergy = 1500 OR (energy> = 500 andenergy <1000)

If you like as, you can add the as select id as xxx, name as xxx, energy as xxx

* If the energy you want to verify has a fixed number of 100 200 300 400
Select id, name, energy from db_name where engrgy in (100,200,300,400)
You can search and print the existing ones. Numbers that do not exist cannot be searched.

You can also use the in keyword field roldid (id) to query multiple roles)

Take 100 and 200 between two values, including 100 and 200.
Select id, name, energy from db_name where engrgy between '000000' and '000000'
If you want to include a 210
Select id, name, energy from db_name where engrgy between '000000' and '000000' OR (engrgy in (100 ))

Fuzzy search

Select id, name, energy from db_name where engrgy like '% number'

Note that if the number is "0%", the query is 0.


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.