SQL statements in the game test

Source: Internet
Author: User

The basic content is not written here.
1 compound conditions are often used in game testing
in the game generally check how much money the user has left. For example, there is a field energy that represents physical strength
table name is db_role key field id,name (unique)
to query the condition for energy in 15,001 gear, then the second gear is between 500~1000
statement is
Select Id,name,energy from db_name whereenergy =1500 OR ( Energy >=500 andEnergy < +)

like as the words can be again to see the column before adding as  select ID as xxx,name as XXX, energy as xxx

* If you want to verify that the energy has a fixed number of
select id,name,energy from Db_name where Engrgy in (100,200,300,400)
can be searched like this, the existing will print out. Numbers that do not exist are not searched.

Querying multiple roles can also use the In Query key field Roldid (ID)

take 2 values between 100 and 200 that contain 100 and ten
Select Id,name,energy from db_name where engrgy between ' and ' 201 '
If you want to include a specific number of 210
Select Id,name,energy from db_name where engrgy between ' + ' and ' 201 ' OR (Engrgy in ())

Fuzzy query

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

Note If the number is "0%" then the query is 0


SQL statements in the game test

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.