Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)

  • RE: T-SQL query to exclude certain rows

    The Following will exclude the undesired rows.

    [highlight=""];WITH cte

    AS

    (

    SELECT row_number() OVER(PARTITION BY GETDATE() ORDER BY date) AS row , * FROM #MyTable

    )

    SELECT * FROM cte A

    WHERE isnull(( A.event + (SELECT...

  • RE: Request help with a query

    well, I think I had put my comments before properly analysing the solution presented by others.

    thanks for the showing the correct reasons.

  • RE: Request help with a query

    well, I think I had put my comments before properly analysing the solution presented by others.

    thanks for the showing the correct reasons.

  • RE: Subquery in Case When that can produce multiple results for IN query

    Guys, what do you think about the solution presented below:

    SELECT * FROM @UnitsTransacted A

    left outer join@lookups B

    on A.investorcode=B.[value] and B.description=@InvestorCode

    where A.investorcode= isnull(@InvestorCode,A.investorcode) or B.description=@InvestorCode

  • RE: Request help with a query

    I do not know why such a long query has been posted. it can be solved like this:

    select * from vehicle_det A

    where duehours= (select min(duehours) from vehicle_det where vehicle= A.vehicle)

    --...

  • RE: Determine Traffic Light Status with Sql

    select A.tableAid , TrafficLightId, B.colour AS colour from #TableA A

    inner join #TrafficLight B

    on. A.TableAId=B.TableAId_Fk

    where case compareoperator when '>' then A.value end > convert(varchar(20),compareoffset) OR

    case compareoperator when...

  • RE: Bulk Insert From CSV using OPENROWSET

    INSERT INTO chief_product (name, description, price, sale_price, vendor_number, vendor_name, product_code, sortorder, type, showitem, parentid, children, new_date)

    SELECT *

    FROM OPENROWSET(BULK '\\path\bulk.csv', FORMATFILE='\\path\bulk_format.Xml', FIRSTROW = 2) as t1

    inner join...

Viewing 7 posts - 1 through 7 (of 7 total)