0
我当前的SQL语句是MySQL的 - 使用ABS()和与应用的标签 “AS”
"SELECT ID,ABS(tvshows-$tvshows) + ABS(actionandadventure-$actionandadventure) + ABS(anime-$anime) + ABS(childrenandfamily-$childrenandfamily) + ABS(classics-$classics) + ABS(comidies-$comidies) + ABS(cultmovies-$cultmovies) + ABS(documentaries-$documentaries) + ABS(dramas-$dramas) + ABS(faith-$faith) + ABS(foreign1-$foreign1) + ABS(gay-$gay) + ABS(horror-$horror) + ABS(independent-$independent) + ABS(music-$music) + ABS(musicals-$musicals) + ABS(independent-$independent) + ABS(music-$music) + ABS(musicals-$musicals) + ABS(romance-$romance) + ABS(scifi-$scifi) + ABS(sports-$sports) + ABS(thrillers-$thrillers) as total FROM accounts WHERE ID != '$ID' ORDER BY total ASC LIMIT 20
我希望做的是有每个ABS如
"SELECT ID,ABS(tvshows-$tvshows) AS totaltvshows + ABS(actionandadventure-$actionandadventure) AS totalactionandadventure + etc...
单个标签
这可能吗?
什么会的标签呢?你的意思是你想要每个项目的列和总数? – IMSoP 2014-12-04 22:13:49
你不能只是做一些像“SELECT ID,ABS(tvshows- $ tvshows)AS totaltvshows,...,totaltvshows + ... FROM? – marcosh 2014-12-04 22:16:09