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"
views:
127answers:
3
+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
2010-08-04 14:34:22
+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
2010-08-04 14:34:57
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
2010-08-04 14:37:27