Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Select a specific row

Author  Topic 

oahu9872
Posting Yak Master

112 Posts

Posted - 2006-01-19 : 10:09:45
I have a page that functions as a slide show that uses the following fields ....

PictureID
PictureFile
PictureCaption.

The page is reached through a homepage where you click on a randomly generated image from the slide show. I want the slide show then to start with the record that was clicked on from the homepage. So something like ...

Select * from tblPictures where PictureID = '" & PictureID & "'

Only I want something more like "where PictureID starts with '"&PictureID&"'

Does that make any sense? I'm not sure if you can do that or not.


Thanks

szgldt
Starting Member

10 Posts

Posted - 2006-01-19 : 11:43:19
Could you not use the LIKE expression? Its uses the % symbol as a wildcard

e.g.

SELECT * FROM tblPicture WHERE PictureID LIKE 'PIC01%'
Go to Top of Page

oahu9872
Posting Yak Master

112 Posts

Posted - 2006-01-19 : 12:41:37
the problem with that is that it will give me the specific picture i clicked on from the homepage, but it will only return that picture in the result set. i want it to return all rows, but start with that row. you know what i mean.


Go to Top of Page

DustinMichaels
Constraint Violating Yak Guru

464 Posts

Posted - 2006-01-19 : 13:40:34
Maybe you could return two result sets. The first one could contain the first picture you want to display and the second result set could be the rest of the pictures.
Go to Top of Page

oahu9872
Posting Yak Master

112 Posts

Posted - 2006-01-19 : 13:51:27
I'll try that with the multiple result sets. that sounds like it could probably work. thanks
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2006-01-19 : 13:58:14
it would be much easier to figure out what you are looking for if you provided a clear example.
Go to Top of Page
   

- Advertisement -