Forum Replies Created

Viewing 15 posts - 181 through 195 (of 211 total)

  • RE: first-in first-out profit calculation

    Jacob Wilkins - Thursday, March 15, 2018 4:22 PM

    If I understand the requirements correctly, here's one method:

    WITH
    n   AS...

    Saravanan

  • RE: Only show the latest date in a selection of data

    jon.clay 91459 - Tuesday, January 2, 2018 8:36 AM

    Hi there everyone

    I'm having problems using the MaxDate function in SQL and wondered if...

    Saravanan

  • RE: case statement

    soldout6000 - Sunday, December 24, 2017 8:56 AM


    Create table main
    (name varchar,
    member_type_id integer)

    Following are the values in main table.
    Name ...

    Saravanan

  • RE: case statement

    Can you kindly provide more  details along with sample data and also what you mean by I'm getting the result of only first case?

    Saravanan

    Saravanan

  • RE: How to select count based on two columns combination

    Can you kindly elaborate how you got count=3 and count=1?

    Saravanan

    Saravanan

  • RE: Conditional CONDITION - CASE in WHERE

    etl2016 - Tuesday, December 12, 2017 11:10 AM

    Hi,
    I have a requirement where I need a SELECTIVE condition under WHERE clause which has...

    Saravanan

  • RE: "Tag" highest value in the month

    Hi,

    You are right. I made a small mistake.Below query gives accurate results. But you can Jeff Moden query as his query is always efficient.

    Saravanan

  • RE: "Tag" highest value in the month

    Hi ,
    Your SQL formatting looks very good. What tools your using for paste the query with color and proper formatting.

    Solution:

    WITH cte
    AS (SELECT
    ...

    Saravanan

  • RE: "Tag" highest value in the month

    Hi,
    Welcome to SQL Central

    create table calendar
    (
    [date] date,
    value int);

    insert into calendar values ('11/1/2017',123);
    insert into calendar values ('11/2/2017',130);
    insert into calendar values ('11/3/2017',140);

    Saravanan

  • RE: Remove duplicate values

    Thanks John. I posted the test data similar to what we got in Hive results(test data is coming like this may be due to hive nature as there is no...

    Saravanan

  • RE: Remove duplicate values

    jcelko212 32090 - Thursday, December 7, 2017 11:51 AM

    saravanatn - Wednesday, December 6, 2017 1:00 AM

    Saravanan

  • RE: Remove duplicate values

    Thom A - Wednesday, December 6, 2017 5:23 AM

    saravanatn - Wednesday, December 6, 2017 4:49 AM

    Saravanan

  • RE: Remove duplicate values

    Thanks Thorn and John . Will test with more test data and get back to you guys.

    Regards,
    Saravanan

    Saravanan

  • RE: Remove duplicate values

    I am just giving(test data just) an example that (ID=4 )records should be returned even if all the non primary keys columns are null. Because count=1 for ID=4 ....Regards,
    Saravanan

    Saravanan

  • RE: Remove duplicate values

    That's good question I haven't got records like that . But I would like to exclude that records as well.

    Regards,
    Saravanan

    Saravanan

Viewing 15 posts - 181 through 195 (of 211 total)