Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
Smasher
Forum Commoner
Posts: 38 Joined: Fri Apr 20, 2007 5:22 am
Post
by Smasher » Thu Jun 14, 2007 4:02 am
query("
SELECT c.id, g.id as Gid
FROM containment c
FROM geezer g
ORDER BY c.`order`, g.`order`");
Then ofcourse loop through them...is it possible without using a join? They aren't joined in anyway possible, but I need to retrieve there dataset in one.
Smasher
Forum Commoner
Posts: 38 Joined: Fri Apr 20, 2007 5:22 am
Post
by Smasher » Thu Jun 14, 2007 4:11 am
CROSS JOIN.
Just for reference.
Gente
Forum Contributor
Posts: 252 Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:
Post
by Gente » Thu Jun 14, 2007 4:52 am
And what about count of c.id and count of g.id. Are you sure they are equal?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Jun 14, 2007 7:58 am
You're looking for a UNION.
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Thu Jun 14, 2007 11:53 am
Code: Select all
SELECT c.id, g.id as Gid FROM containment c, geezer g WHERE c.tkey=g.tkey ORDER BY c.`order`ASC, g.`order` ASC