Jump to content

getting one item pre department


divinedesigns1
 Share

Recommended Posts

ok, i think im going in too deeply here, but i would like to accomplish this as an achievement and as a learning process.

 

i have 3 tables in my database at the moment, these database are x, y, z. i would like the database Y, which holds all the items and department numbers to display 1 or 2 of each items within those departments.

 

how do i go about doing this? any tips? hint? or advice?

Link to comment
Share on other sites

hey dds1, do you mean you have one database and inside this database you have 3 tables x, y, and z?

correct Don E.........you name is common in anime

Link to comment
Share on other sites

Is there any kind of criteria for which item to show or just any item? The lazy way would be to send one query that gets the distinct department IDs, and then loop through those and send a query to get 1 row with each department ID. A more complex way would be to use a join or subquery where you get the distinct list and then join it with the same table.

Link to comment
Share on other sites

Is there any kind of criteria for which item to show or just any item? The lazy way would be to send one query that gets the distinct department IDs, and then loop through those and send a query to get 1 row with each department ID. A more complex way would be to use a join or subquery where you get the distinct list and then join it with the same table.

the complex way sound more promising than the lazy way

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...