Can you show a small coding example of what you have tried so far? It is hard to tell where your problem is without seeing any code.
To get data out of the database you simple have to use a sql query, the general form would be like this
data <- sqlQuery(connection_name, 'SQL query')