This is a discussion on "Having two record sets" within the Classic ASP section. This forum, and the thread "Having two record sets are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Having two record sets
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Having two record sets
What i want is a table of pictures and comments.
Pictures on the left, and the four most recent comments about the pictures on the right. I have a database table of pictures, with a picture ID as unique, and also a comments table, also having the picture ID, how can i get a recordset from both at the same time?? |
|
|
|
#2
|
|||
|
|||
|
use a JOIN in your databse query, based on the matching PictureID.
Which database are you using? |
|
#3
|
|||
|
|||
|
access, if I do a join how will the recordset be arranged?
because the amount of comments is many to one picture. I shall try it and see what happens |
|
#4
|
|||
|
|||
|
you'll need to 'group by' the PictureID I think
|
|
#5
|
|||
|
|||
|
i have made a query in my access database which seems to do the trick, couldnt get the SELECT FROM to work, kept getting FROM syntax error
|
|
#6
|
||||
|
||||
|
For acceesm try 'Select * From'
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#7
|
||||
|
||||
|
I know I'm late, but I don't think you cant use "SELECT *" when joining tables
also, he wants to get one record from the pictures table and 4 from the comments table. best to do is: - load picture record - save id as a variable - close picture recordset - load comments used the saved id - blah blah blah...
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
#8
|
|||
|
|||
|
One method is called data shaping. It let's you return a recordset as a field in another recordset. (I know that's not a very clear description)
Check out http://www.4guysfromrolla.com/webtech/092599-1.shtml or google it. |
![]() |
| Tags |
| having, two, record, sets |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| record keeping | karmaman | E-Commerce and Business | 1 | Sep 19th, 2007 10:45 |
| Updating a record | Wheatus7 | Classic ASP | 0 | Jun 3rd, 2007 06:56 |
| Record videos on your pc | Pádraig | Webforumz Cafe | 10 | May 2nd, 2007 19:04 |
| insert record | accessman | Databases | 1 | Oct 15th, 2005 01:12 |
| Insert Record | redkyna | Classic ASP | 11 | Aug 25th, 2004 22:46 |