开发者

How do you write a select for the intersection of two condidtions in Microsoft Access?

I want to write a select query with the firstname and lastname of a person. I have written queries 开发者_运维知识库for each. As I am using Microsoft Access, I can't get the intersection of the two. So What would be the another option for me to retrieve all the records with the letters of fname and lname of a person. The query I have right now is as follows:

select Registration_No, FName, MName, LName 
from Registration 
where FName like '" + fname + "%' 
    AND select Registration_No, FName, MName, LName 
    from Registration 
    where LName like '" + lname + "%' " ;

What should I change to make this work?


To construct a basic SQL command of this kind, you combine all your search stuff and put it after the WHERE like this:

select Registration_No, FName, MName, LName 
from Registration 
WHERE FName like '" + fname + "%' 
    AND LName like '" + lname + "%' " ;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜