Grabbed a query from some old code and I'm trying to make it work. Every time I submit the query I get the error:
Error code 207, SQL state S0001: Invalid column name 'Grade'
Code:
SELECT
COUNT(*) AS PieceCount
,shifttimes.shiftid AS ShiftId
,specienames.NameText AS Specie
,gradenames.NameText AS Grade
,DryerNum
,CreatedLocal
FROM
sheets, shifttimes, Specienames, GradeNames
WHERE
sheets.ShiftIndex = shifttimes.ShiftIndex
AND sheets.SpecieNameIndex = specienames.NameIndex
AND sheets.gradenameindex = gradenames.NameIndex
AND CreatedLocal >= '2015-04-01'
AND CreatedLocal < '2015-06-01'
GROUP BY
ShiftId, Grade, DryerNum, Specie
JOINsyntax in the ANSI-92 SQL Standard (more than 20 years ago) and its use is discouraged