0

我正在使用两个表 postjob 和 job location 想要区分 jobtitle

查询是:

select postjob.jobtitle,
postjob.industry,
postjob.companyname,
postjob.jobdescription,
postjob.postid,
postjob.PostingDate,
Job_Location.Location,
Job_Location.PostigID 
from postjob 
inner join Job_Location 
on postjob.postid = Job_Location.PostigID 
Where postjob.industry=' Marketing, Advertising'

此查询的输出 http://www.justlocaldial.com/Industry_search.aspx?ind=Marketing,%20Advertising

4

1 回答 1

1

根据需要填写数据,并让我们了解如何显示数据,以便我们尝试找到解决方案;你可以在 postjob.postid 上区分这给出了独特的数据

现场演示 http://sqlfiddle.com/#!3/2d53c/4

create table postjob
(postid int identity(1,1),jobtitle nvarchar(50),industry nvarchar(30),
jobdescription nvarchar(150),PostingDate datetime)

insert into postjob values('Programmer','Software','User interface','2012-07-04 15:00:24.833')
insert into postjob values('Tester','Software','Automated Testing Application','2012-07-04 15:00:24.833')
insert into postjob values('Sales Executive','Marketing','Meeting with clients','2012-07-04 15:00:24.833')
insert into postjob values('Doctor','Hospitality','Treatment','2012-07-04 15:00:24.833')
insert into postjob values('Desinger','Software','User interface graphicdesinger','2012-07-04 15:00:24.833')
insert into postjob values('Desinger','Interior','Blah blah','2012-07-04 15:00:24.833')

create table Job_Location(PostigID int,Location nvarchar(50))
insert into Job_Location values ('1','India')
insert into Job_Location values ('2','Italy')
insert into Job_Location values ('3','Germany')
insert into Job_Location values ('4','France')
insert into Job_Location values ('5','India')
insert into Job_Location values ('6','USA')
于 2012-07-04T09:52:58.777 回答