Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
370 views
in Technique[技术] by (71.8m points)

Guidance on Subquery at Expression at MS Access

Have a requirement as below,

  1. Table1 having Employee ids and Managers id
  2. Query1 having only distinct manager ids

Requirement: Create a query with Employee id and an expression as Whether that employee is a manager or not

SELECT [Table1].Empld,        
       IIf(((Select count(*) from [Query1] where [Query1].[Manager]=[Table1].[Empld]) >  0),"Yes","No") AS IsManager
FROM [Table1]

But this query is not working :(. Please advise how we can achieve this

Updating additional comments:

Table1:

Empld Manager
1 9
2 1
3 1
4 1
5 2

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...