I have a simple query in my code (shown below) written by my colleague. What does t
mean here? Also what is the role of the ;
inside the query? I am dead sure that t
is not any table, nor any field anywhere in my database. And guess what this query works!!
string query = @"SELECT COUNT(*) FROM (SELECT AttemptNo FROM attempt_exercise
WHERE FK_UId = @uId AND FK_EId = @eId AND Mode = @mode)t;
";
The code follows like this (for any other info if required):
MySqlCommand cmd = new MySqlCommand(query, _conn);
cmd.Parameters.AddWithValue("@uId", uId);
cmd.Parameters.AddWithValue("@eId", eId);
cmd.Parameters.AddWithValue("@mode", mode);
attemptCount = Convert.ToInt32(cmd.ExecuteScalar());
_conn.Close();
return attemptCount;