Home Forums SQL Server 2008 SQL Server Newbies Display two fields of two UNRELATED tables WITHOUT crossjoin RE: Display two fields of two UNRELATED tables WITHOUT crossjoin

  • In this particular case, since you want the two counts...

    SELECT q1, q2 FROM

    (SELECT Count(a.PK) as q1 FROM Table1 as a) t1,

    (SELECT Count(b.PK) as q2 FROM Table2 as b) t2

    Only in this case though.

    In general the question can't be answered. How can you meaningfully join two completely unrelated tables and have the columns related to each other? If they are completely unrelated, then they probably shouldn't even be in the same query

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass