Hello Guys,
I want take your help to solve out my question so please give me better way to implement the query to get records from search parameter
Below I have drawn one scenario and from that I want to get result
Suppose one organization held the draw of lottery ticket of various categories
LotteryTicketBuyerMaster
BuyerId(Int)
BuyerName(varchar)
EmailId
Category(varchar)
TicketNo(Varchar)
1
Nicks
[email protected]
Electronics
11001,11007
2
Automobiles
14015,14020
3
James
11002,11005
4
14016,14017
5
Mike
11003
6
Nelson
11004,11006
7
Mira
Furniture
13001
8
Jack
14018,14019
9
Mark
13002,13004
10
Lary
13003
LuckyTicketMaster
1st Day Draw
DrawDate(Date)
Category(Varchar)
LuckyTicketNo(Varchar)
01/03/2017
11001,11003
14016,14018
2nd Day Draw
02/03/2017
11005,11006
14018,14020
13002,13003
And at end of the each day I want to send email to lucky winner so, how to write a query in better way to get winner Name and Email in LotteryTicketBuyerMaster from TicketNo by LuckyTicketMaster’s LuckyTicketNo
ResultTable
1st Day ResultTable
Date
BuyerName
Emailid
Category
TicketNo
11001
14016
14018