Skip to content
Advertisement

Tag: group-by

Custom SQL response (JOIN TABLE)

I have two tables, table1 and table2 I want to link the two tables with the id, by grouping the information in one and the same answer. table1: ╔════╦══════════════╦ ║ id ║ product_id ║ ╠════╬═══…

Why I get error group by result of subquery?

I want to find the number of trace records which has same telephone,project_id,create_time,trace_content But this sql: returns wrong result. If I use: returns correct result. Mysql version is 5.6.26 Could anyone tell me the reason? For example the table contains these data: id = 1, project_id = 1, telephone = 1, trace_contest = test, creatime = 2020-01-16 18:27:46 id =

Advertisement