Home Page   #c  #ruby-lang  #cisco  #mysql  #apache  #javascript  #java  #perl  #php  #openmoko   Wallpapers Girl
Reliable $1 Web Hosting by 3iX

Channels


#mysql

30 October 2007


Total 22 pages. You are browsing page 22/22.

First :: Prev :: [...] [18] [19] [20] [21] [22] :: Next :: Last

23:51 <****> flexo: Just the union.
23:51 <****> flexo: SELECT t2.* FROM (SELECT name, MAX(age) AS age FROM (some simple of complex derived table) GROUP BY name) AS v1 JOIN (the same simple or complex derived table) t2 ON v1.name = t2.name AND v1.age = t2.age;
23:52 <****> flexo: I meant literally "the same derived table goes here"
23:52 <****> I did put the same table, no?
23:52 <****> flexo: No.
23:53 <****> flexo: (stuff) AS fulltable ... duplicate that entire mess.
23:54 <****> flexo: But call it t2, not fulltable.
23:54 <****> flexo: the name doesn't matter, but you already use t2 in that last JOIN.
23:54 <****> So everythign inside the 2nd FROM?
23:55 <****> flexo: (stuff) AS fulltable ... I want you to replace the second fulltable with (stuff), literally.
23:56 <****> flexo: Including the ()'s.
23:56 <****> $sql = "SELECT t2.nid, t2.cid, t2.title FROM
23:56 <****> (SELECT uid, MAX(timestamp) as maxtime FROM ((SELECT n.nid, n.uid as uid, NULL as cid, n.title as title, n.created as timestamp FROM {node} n
23:56 <****> WHERE n.type = 'forum' AND n.status = 1)
23:56 <****> UNION ALL (SELECT c.nid, c.uid as uid, c.cid as cid, c.comment as title, c.timestamp as timestamp FROM {comments} c
23:56 <****> WHERE c.status = %d)) AS fulltable
23:56 <****> GROUP BY uid) AS v1
23:56 <****> JOIN ((SELECT n.nid, n.uid as uid, NULL as cid, n.title as title, n.c
23:56 <****> opps
23:56 <****> http://pastebin.com/m77173538
23:56 <****> flexo: Something like that.
23:56 <****> seems oftely repetitive
23:57 <****> flexo: Yes. it is.
23:57 <****> and I'm still getting errors with it.
23:57 <****> if i do a union , on selectquery1 and selectquery2, shouldnt the data come up as selectquery1 , then selectquery2 ? why is my data seem to be reversed?
23:57 <****> user warning: Unknown column 't2.maxtime' in 'on clause' query:
23:57 <****> i mean, data should come up with , selectquery1 followed by selectquery2 right?
23:58 <****> flexo: Don't make up column names.
23:58 <****> that's for the max(timestamp)
23:59 <****> flexo: v1.maxtime is correct.
23:59 <****> flexo: t2 has no such column.
23:59 <****> flexo: It's called t2.timestamp
23:59 <****> right, because I only recreated what was in (stuff)
--- Log closed Wed Oct 31 00:00:01 2007


Total 22 pages. You are browsing page 22/22.

First :: Prev :: [...] [18] [19] [20] [21] [22] :: Next :: Last


Tutti i nuovi CAP Italiani. Come ottenere il database completo