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