{"action":"opened","issue":{"url":"https://api.github.com/repos/sqlmapproject/sqlmap/issues/1545","labels_url":"https://api.github.com/repos/sqlmapproject/sqlmap/issues/1545/labels{/name}","comments_url":"https://api.github.com/repos/sqlmapproject/sqlmap/issues/1545/comments","events_url":"https://api.github.com/repos/sqlmapproject/sqlmap/issues/1545/events","html_url":"https://github.com/sqlmapproject/sqlmap/issues/1545","id":117573545,"number":1545,"title":"Downloading a table when the pivot don't get all","user":{"login":"rodrigozanatta","id":812863,"avatar_url":"https://avatars.githubusercontent.com/u/812863?v=3","gravatar_id":"","url":"https://api.github.com/users/rodrigozanatta","html_url":"https://github.com/rodrigozanatta","followers_url":"https://api.github.com/users/rodrigozanatta/followers","following_url":"https://api.github.com/users/rodrigozanatta/following{/other_user}","gists_url":"https://api.github.com/users/rodrigozanatta/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigozanatta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigozanatta/subscriptions","organizations_url":"https://api.github.com/users/rodrigozanatta/orgs","repos_url":"https://api.github.com/users/rodrigozanatta/repos","events_url":"https://api.github.com/users/rodrigozanatta/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigozanatta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-18T12:10:10Z","updated_at":"2015-11-18T12:10:10Z","closed_at":null,"body":"When you try to get a table, the sqlmap use\r\n\r\nDISTINCT(COUNT(columnName))\r\n\r\nBut, what happens when NONE column have the exact number of distinct in the table? Well, it will NOT download all data. How solve it?\r\n\r\nWhy not use more than one column? And it worked for me. If I use:\r\n\r\nDISTINCT(COUNT(SELECT (CAST(columnName AS VARCHAR(4000))+CHAR(100)+(CAST(secondColumn AS VARCHAR(4000))  )))\r\n\r\nYou can use more columns as pivot until it get all elements.\r\n\r\nIn the select, I just get the two column plus more data and use it as a pivot. You can use some good logic, but the idea is it. \r\n\r\nI STRONGLY recommend use LTRIM(RTRIM()) for any column in the pivot, because I spend a lot of time thinking why it wasn't working. "}}