Home > Software engineering >  Where is the SQL statement is wrong?
Where is the SQL statement is wrong?

Time:09-28

SELECT the Name, Sex, COUNT (1) the FROM Student
I use the SQL statement above, want to get the Name and the Sec column in the Student table, and obtain the table of the total number of rows, but after I use sqlite3_exec execute the SQL statements, the callback function is performed only once, and then no longer perform the callback function, but my is more than one row of data in this table, there are hundreds of lines of data,

CodePudding user response:

No such use, two calls, to obtain the Name and Sec column at a time, a table for the total number of rows,

CodePudding user response:

Select the name, sex, CNT from student, (select count (1) as the from CNT student)

CodePudding user response:

SELECT the Name, Sex, COUNT (1) FROM the Student, it is the total number

CodePudding user response:

SELECT the Name, Sex, COUNT (1) the FROM Student group by Name, Sex

CodePudding user response:

SELECT the Name, Sex, COUNT (1) the FROM Student group by Name, Sex

CodePudding user response:

reference 5 floor ZXPHXH reply:
SELECT Name, Sex, COUNT (1) the FROM Student group by Name, Sex


With aggregation function in the query, will need to use group by

CodePudding user response:

Suggest the original poster read through SQL Server Chinese version online help,
  • Related