divinedesigns1 Posted October 8, 2015 Share Posted October 8, 2015 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 More sharing options...
Don E Posted October 8, 2015 Share Posted October 8, 2015 hey dds1, do you mean you have one database and inside this database you have 3 tables x, y, and z? Link to comment Share on other sites More sharing options...
divinedesigns1 Posted October 8, 2015 Author Share Posted October 8, 2015 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 More sharing options...
justsomeguy Posted October 9, 2015 Share Posted October 9, 2015 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 More sharing options...
divinedesigns1 Posted October 9, 2015 Author Share Posted October 9, 2015 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now