一、Mysql高级语句查询
#1.以别名形式查询编号和姓名 selete id 编号,name 姓名from info; #2.查询编号为1的人的编号和姓名 select id,name from info where id=1; select id,name from info where name=‘张宇’; #3.模糊查询 select name,sex from info where name like’张%’; select naem,age from info where name like’张%‘or name’甘’; like’’; #4.查询年龄为空的人的姓名和年龄 select name,age from info where age is null; #5.查询年龄不为空的人的姓名和年龄 select name ,age from info where age is not null; #6.查询年龄在13-18之间的人的姓名和年龄 select name,age from info where age>=13and age<=18; select name,age from info where age between 13 and 18; #7.查询姓名是张宇的人的姓名(唯一的) select distinct name from info where name=‘张宇’;
#8.按年龄升序查询 人的姓名和年龄 select age,name from info order by age; select age,name from info order by age asc; #9.按年龄降序查询 人的姓名和年龄 select age,name from info order by age desc;
#10.按多列排序查询人的编号、姓名、年龄(当年龄相同时才按id排列) select id,name,age from info order by age,id desc
#11.查询前三条数据(编号 姓名 )第一页 select id,name,age from info limit 0,3; #0:从0开始 3:总条数 limit id,name from limit 3;
#12.查询两条数据 select id,name from info limit 3,2;
select id 编号,name 姓名 from info;
select id,name from info where id=1;
select id,name from info where name='张宇';
select name,sex from info where name like'张%';
select name ,sex from info where name like '张%' or name like '甘%';
select name ,age from info where age is null;
select name ,age from info where age is not null;
select name,age from info where age between 13 and 18;
select name,age from info where age >=13and age<=18;
select distinct name from info where name='张宇';
select name,age from info order by age;
select name,age from info order by age asc;
select name,age from info order by age desc;
select id,name,age from info order by age,id desc;
select id,name from info limit 0,3;
select id,name from info limit 3;
select id,name from info limit 3,2;
二、unity下gameobject和transform的区别和关联
Transform 是一个类,用来描述物体的位置,大小,旋转等等信息。 transform 是Transform 类的对象,依附于每一个物体。也是当前游戏对象的一个组件(每个对象都会有这个组件)
Gameobject 是一个类型,所有的游戏物件都是这个类型的对象。 gameobject 是一个对象, 就跟java里面的this一样, 指的是这个脚本所附着的游戏物件
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
public GameObject m_gameOject;
public Transform m_transFrom;
void Start () {
m_gameOject = this.gameObject;
m_transFrom = this.transform;
print("gameOject.name ==>" + m_gameOject.name);
print("gameOject.transform.name ==>" + m_gameOject.transform.name);
print("gameOject.transform.gameobject.name ==>" + m_gameOject.transform.gameObject.name);
print("gameOject.transform.gameobject.tramsform.name ==>" + m_gameOject.transform.gameObject.transform.name);
print("transform.name ==>" + m_transFrom.name);
print("transform.gameobject.name ==>" + m_transFrom.gameObject.name);
}
void Update () {
}
}
运行结果:
|