create proc getTitleName_proc
@sort_name varchar(50)
as
begin
set nocount on
select title_name from title
where left(sort_id,3) in
(select distinct sort_parentid from sort where sort_name=@sort_name)
set nocount off
end
@sort_name varchar(50)
as
begin
set nocount on
select title_name from title
where left(sort_id,3) in
(select distinct sort_parentid from sort where sort_name=@sort_name)
set nocount off
end
@sort_name varchar(50)
as
begin
set nocount on
select title_name from title
where sort_id in (select sort_id from sort where sort_name=@sort_name)
set nocount off
end
---------------------------------------
exec getTitleName_proc, 'computer'