I am getting below error in my function.

Error: `FROM keyword not found where expected`

And here is my Function:

```
    private int BauteilLieferzeit(string Materianummer)
    {
        try
        {
            OracleCommand cmd = new OracleCommand(
                " Select MATNR, AVG_DAUER" +
                " AVG " +
                    " (DATEDIFF " +
                        " (mi, Z.APL_ANFDATUM, " +
                        " Z.STA_LIEFERDATUM)) " +
                " as AVG_DAUER " +
                " from ZDATA AS Z " +
                " where MATNR = '" + Materianummer + "'" 
                        , OraVerbindung._conn);

            OracleDataReader r = cmd.ExecuteReader();

            if (r.HasRows)
            {
                int Restminuten = OraVerbindung.Lieferzeit;
                while (r.Read())
                {
                    Restminuten = r.GetInt32(1);
                }
                return Restminuten;
            }
            else
            {
                return OraVerbindung.Lieferzeit;
            }
        }
        catch
        {
            return OraVerbindung.Lieferzeit;
        }

    }

```