Jump to content

Archived

This topic is now archived and is closed to further replies.

nadeemshafi9

SQL syntax

Recommended Posts

schema

[b]owner[/b]{
pk ono
fname
lname
adress
}

[b]property_for_rent[/b]{
pk pno
fk ono
adress
}

hi guys here are some tables, the owners own more than one property each

SELECT fname&" "&lname&", "&address AS [owner], pno
FROM property_for_rent p, owner o
WHERE p.ono = o.ono

the prob is i get seperated records for each property owned by a single guy, i need to show his or her details once and then followed by the pno (property number)'s they hav.

let me giv u a visual of what i am getting with the above code

owner 1 pno
owner 1 pno
owner 1 pno
owner 2 pno
owner 3 pno
owner 3 pno
owner 3 pno

let me giv u a visual of what i whant

[b]owner 1[/b] pno
pno
pno
[b]owner 2[/b] pno
[b]owner 3[/b] pno
pno
pno

i know you can count things this way using GROUP BY and COUNT(*) so u must be able to show them this way.

thanks alot for any help.

Share this post


Link to post
Share on other sites
ignore wot i said up there i didnt know what i was talking about then, i do now, sorry, thanx anyway.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.