html table :
Code: Select all
create table html(
id int(4),
title varchar(255),
description varchar(255)
);Code: Select all
create table link(
id int(4),
url varchar(255)
);"SELECT * FROM html LEFT JOIN link using(id) WHERE html.id = '2' "; it will output,
id | title aaaa| descriptionaaaaaaaa | url aaaaaaaaaaa |
2 | page one | This is the page one | http://www.link-1.com |
2 | page one | This is the page one | http://www.link-2.com |
2 | page one | This is the page one | http://www.link-3.com |
sorry, i can't draw table properly here.
So the problem is, i need the http://www.link-1.com, http://www.link-2.com and http://www.link-3.com, and i need the title and description only once but it was repeated for three times which i afraid it's not efficient to repeat the same thing so many times and i was thinking if there is a way to show the three url but only one time of title and description ? in other words is there a better query than this ? Thank you.[/syntax]