--sort 表 分类表 create table Sort( ID int identity(1,1), Title nvarchar(50) not null, Name nvarchar(200) null, ImgUrl varchar(100) null, Content nvarchar(max) null, ViewCount int not null, Type int not null, CreateTime Datetime not null, primary Key(ID), ); go select * from Sort; --别名语法 select p.Title from Sort AS p where p.Title='标题2'; --查询sort表中字段名字为李四的值数据 select p.Name from Sort AS p where p.Name='李四';
效果: