SubSonic Forums
All Your Database Are Belong To Us

SQL inner join generation

Latest post 08-20-2008 4:12 AM by Asero. 2 replies.
  • 08-19-2008 11:28 PM

    • Asero
    • Not Ranked
    • Joined on 08-20-2008
    • Posts 2

    SQL inner join generation

    hi guys,

    im a newbie on subsonic

    could someone interpret this sql query into subsonic code?

    SQL query:

    select Count( Trans.TransId )
    from Trans
    inner join LPSRFileAllocation on LPSRFileAllocation.C4FilePath = trans.FileName
    or LPSRFileAllocation.LGAFilePath = Trans.FileName
    where
    LPSRFileAllocation.C4FilePath = "\\omed-dev-021\RawData\Hybrid\LPSR-Nexiv\LGA-08397510.csv"
    or
    LPSRFileAllocation.LGAFilePath = "\\omed-dev-021\RawData\Hybrid\LPSR-Nexiv\LGA-08397510.csv"

     

    i generate a subsonic code below but doesn't work for me:

     

    new Select(Aggregate.Count(Tran.TransIdColumn))
                                        .From(Tran.Schema)
                                        .InnerJoin(LPSRFileAllocation.C4FilePathColumn, Tran.FileNameColumn)
                                        .Or(LPSRFileAllocation.LGAFilePathColumn, Tran.FileNameColumn)
                                        .Where(Tran.Columns.RecordStatus).IsEqualTo(true)                                    
                                        .Or(LPSRFileAllocation.Columns.C4FilePath).IsEqualTo(filePath)
                                        .Or(LPSRFileAllocation.Columns.LGAFilePath).IsEqualTo(filePath)
                                        .ExecuteScalar<bool>();

     

    thanks in advance..

     

     

     

  • 08-20-2008 2:09 AM In reply to

    Re: SQL inner join generation

    I don't know how this works

    new Select(Aggregate.Count(Tran.TransIdColumn))
                                        .From(Tran.Schema)
                                        .InnerJoin(LPSRFileAllocation.C4FilePathColumn, Tran.FileNameColumn)
                                        .Or(LPSRFileAllocation.LGAFilePathColumn, Tran.FileNameColumn)/*This line is not valid*/
                                        .Where(Tran.Columns.RecordStatus).IsEqualTo(true)                                    
                                        .Or(LPSRFileAllocation.Columns.C4FilePath).IsEqualTo(filePath)
                                        .Or(LPSRFileAllocation.Columns.LGAFilePath).IsEqualTo(filePath)
                                        .ExecuteScalar<bool>();

    If I am I because I am I, and You are You because You are You, then I am I, and you are you. But If I am I because You are You, and You are You because I am I, then I am not I and You are not You. -Rabbi of Kotzk

  • 08-20-2008 4:12 AM In reply to

    • Asero
    • Not Ranked
    • Joined on 08-20-2008
    • Posts 2

    Re: SQL inner join generation

    thank you sir yitzchok for the reply..

     .Or(LPSRFileAllocation.LGAFilePathColumn, Tran.FileNameColumn)/*This line is not valid*/
     
    that line causes the error..

    im trying to figure out if theres any workaround on that line of codes..

    could anyone know how?..tnx Smile

Page 1 of 1 (3 items) | RSS