PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 27th, 2001, 08:50 PM
Entemedia Entemedia is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 5 Entemedia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Retrieving multiple rows

hello,

i need your help to my question:

i have this database called test, and i have a table called data. The table structure is as follow

cID SMALLINT
bID SMALLINT
name TEXT
email TEXT
site TEXT

bID is always an unique number for each row, while cID sometimes has same numbers in 2 or more rows. Example:

cID = 1
bID = 1
name = ss
email = ss
site = http://ss

cID = 1
bID = 2
name = ss
email = ss
site = http://ss

bID often differs. My question is see i want to SELECT all the rows that are the same cID. Normally i use:

SELECT * from data where cID = 1

but in this case there are more than 1 same values for cID. Is there anyway to retrieve the datas from multiple rows at the same time, and then put all the datas and values to arrays. For instance, in my mind it will be someone like:

test[0] = cID test[1] = bID
test2[0] = cID test2 [1] = another bID



SQL Experts here, Any ideas? Thank you in advance for your help.

Vincent

Last edited by Entemedia : September 27th, 2001 at 08:53 PM.

Reply With Quote
  #2  
Old October 10th, 2001, 03:15 AM
Thrasher Thrasher is offline
Canta como rafaé
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Barcelona
Posts: 74 Thrasher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Send a message via ICQ to Thrasher
Incredible

Please see the manual of the language you are working in. Or you can read some examples, but I have to tell you that, if doing queries is the first step to database access, the second is to retrieve data.
__________________
Thrasher



'Y se ahogaron los dooos
No eran duros pa pagar, cuñaaoo !!'
El vagamundo - El risitas y su cuñao

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > Retrieving multiple rows

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap