SQL Statments _ON_ a query/recordset

R

robertjaym

Hello, I have a problem where I have a dump of data that is a number of
users, and their items all listed together in a large list (table).
I'd like to have unique items only for each of these users, and I was
having trouble finding anyone who knew how to use a "CREATE VIEW"
statement properly (so that I could create a view for each user, and
then remove non-unique items from the view, not affecting other users)

I found what I'm hoping is another way to approach the problem, by
pulling a recordset object of each user, and then performing an SQL
statement on that object (to remove non-unique records, while not
removing non-unique records for all users in the list, while also not
having to split up the list(table) into multiple tables).

Anyone know how to do this? (perform an SQL statement on an recordset
object)...

I thought I could refer to the original query by name.. but I cannot
set the name of the query, and the name of it is the query itself!

rjm
 
J

Jamie Collins

I'd like to have unique items only for each of these users, and I was
having trouble finding anyone who knew how to use a "CREATE VIEW"
statement properly

Something like

REVOKE ALL PRIVILEGES ON MyTable FROM Jamie;

CREATE VIEW JamieData
AS
SELECT data_value AS jamie_value
FROM MyTable
WHERE user_name = 'Jamie'
WITH OWNERACCESS OPTION;

GRANT SELECT ON JamieData TO Jamie;

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top