Index view cursor

Source: Internet
Author: User
Index:

You can quickly access data without scanning the entire table.

The binary type does not support indexing.

View:

Exporting the displayed table from one or more basic tables is a virtual table without data.

Multiple tables have one view, one table has multiple views, and multiple tables and one view have one view.

Cursor:

All databases: the order of rows is irrelevant, and the order of columns is irrelevant.

Select Code, name, brand_name, prod_name, oil, price from car

Join brand on car. Brand = brand. brand_code

Join productor on productor. prod_code = brand. prod_code

Select * From viewcar

 

Select * From chinastates where parentareacode = '37'

 

Create view Shandong

As

Select * From chinastates where parentareacode = '37'

Go

 

Select * from Shandong

 

Insert into Shandong (areacode, areaname, parentareacode, root, zone) values ('20170101', 'line', '38 ','','')

 

Select * From viewcar

Insert into viewcar values ('c222', 'lu light electric vehicle ', 'Super strong continued king', 'shandong light Kid', '0', '5 ')

 

Declare cur_car cursor scroll

For select name from car where name like 'audi %'

Open cur_car

Fetch first from cur_car

While @ fetch_status = 0

Begin

Declare @ name varchar (50)

Fetch next from cur_car into @ name

-- Print @ name

If ltrim (left (@ name, Len ('audi A4 07 ') = 'audi A4 07'

Begin

Fetch prior from cur_car into @ name

Print @ name

Fetch relative 2 from cur_car into @ name

Print @ name

End

End

Close cur_car

Deallocate cur_car

 

Index view cursor

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.