tags:

views:

127

answers:

3
SELECT "D"."Name", "D"."Sname", "D"."Date, "D"."Type", 
       "D"."Place", "D"."Unit1", "D"."Unit2" 
FROM "Data" AS "D", "Search" AS "S" 
WHERE "D"."Name" = "S"."Name" AND "D"."Sname" = "S"."Sname" 
      AND "D"."Place" = "S"."Place"
+1  A: 

Without some background and the error message we can't really help you. The only thing I can think of based on your data is that maybe you are getting too much information in which case you should use a JOIN (INNER, OUTER, LEFT)

SELECT D.Name, D.Sname, D.Date, D.Type, D.Place, D.Unit1, D.Unit2 
FROM Data AS D
JOIN Search AS S 
ON D.Name = S.Name, D.Sname = S.Sname, D.Place = S.Place
Kyra
+1  A: 

Table and column names should not be quoted. Join should be stated explicitly, not through comma.

SELECT 
  D.Name, D.Sname, D.Date, D.Type, D.Place, D.Unit1, D.Unit2 
FROM 
  Data AS D 
CROSS JOIN 
  Search AS S 
USING (Name, Sname, Place)
Mchl
A: 

Use the backtick ` instead of "

SELECT D.`Name`,
    D.`Sname`,
    D.`Date,
    D.`Type`,
    D.`Place`,
    D.`Unit1`,
    D.`Unit2`
FROM `Data` AS D,
    `Search` AS S
WHERE D.`Name` = S.`Name`
AND D.`Sname` = S.`Sname`
AND D.`Place` = S.`Place`

Also format your code (like above).

Coronatus