I am trying a multi select query in management studio and I am only expecting a result that is a single output per row, however, when I tried executing it. The rows I called repeated once. For example I have 2 rows in my column1 and when I multi-selected my tables. I received 4 rows which is just a CLONE of the 2 rows. To make things clear here's the full detail of my database and tables:
Database : MMDAserver
Tables : dbo.Records, dbo.DriverInfo, Vio.ViolationList
Columns in dbo.Records :
PlateNo
[Violation Commited]
[Street Name]
VCategory
VType
Date
Columns in dbo.DriverInfo :
[License Number]
[Reg'd Last Name]
[Reg'd First Name]
[Reg'd Middle Name]
[Reg'd Address]
[Address' City Code]
[Reg'd B-Date]
[Plate Number]
[Conduction Number]
[Vehicle Category]
[Vehicle Type]
[Vehicle Brand]
Columns in Vio.ViolationList
ViolationCode
ViolationD
FineAmnt
Here's my multi-select query:
[B]SELECT[/B] Vio.ViolationList.ViolationCode,Records.[Violation Commited],Vio.ViolationList.FineAmnt,DriverInfo.[Plate Number]
,DriverInfo.[License Number],DriverInfo.[Reg'd Last Name],DriverInfo.[Reg'd First Name],DriverInfo.[Reg'd Middle Name],DriverInfo.[Reg'd Address],
DriverInfo.[Address' City Code],DriverInfo.[Reg'd B-Date],DriverInfo.[Conduction Number],
DriverInfo.[Vehicle Category],DriverInfo.[Vehicle Type],DriverInfo.[Vehicle Brand]
,Records.[Street Name],Records.[Date]
[B]FROM[/B] Vio.ViolationList,DriverInfo,Records
[B]WHERE[/B] Records.PlateNo like DriverInfo.[Plate Number]
and Records.[Violation Commited] like Vio.ViolationList.ViolationD
(I have placed an attachment where the output of this is shown. It's filename is output.jpg)
I've tried to test another query,which I narrowed down, to see where it might be going wrong:
[B]SELECT * FROM[/B] Records,DriverInfo,Vio.ViolationList
[B]WHERE[/B] Records.PlateNo like DriverInfo.[Plate Number]
and Records.[Violation Commited] like Vio.ViolationList.ViolationD
When I removed the and Records.[Violation Commited] like Vio.ViolationList.ViolationD and the FROM Vio.ViolationList. It just works fine. No clones. And I think the problem occurs from there. Any suggestions?