MS SQL tutorial showing how to return the latest record from a table

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 พ.ย. 2024

ความคิดเห็น • 9

  • @asutosh_nayak
    @asutosh_nayak 2 ปีที่แล้ว

    Simple and sufficient 😁 thanks man

  • @mariansweetheart
    @mariansweetheart ปีที่แล้ว

    In my system (zoho analytics) can't do that, but I saved the query and then created a new one and I take the values from there, but when I try to obtain other data like the amount, and I join by customer ID, duplicates everything because I have more the one customer ID, since there's more the one sales order. How can I fix that? Thank you for your video.

  • @takaKizne007
    @takaKizne007 2 ปีที่แล้ว

    I have a list of orders. Each time the status is updated for the order, the order duplicates with the latest date (ex. Order 7887 opened on 11/6, order 7887 closed on 11/8)
    Do use the MAX() on the date or the order number itself to find the latest update for that Order?

  • @lakenkennedy3800
    @lakenkennedy3800 2 ปีที่แล้ว

    You are awesome!!

  • @agustriyono
    @agustriyono ปีที่แล้ว

    thank u for your tutorial. i have any problem to take data with new date.
    i use this query. and work
    select *
    from(
    select nama,max(tanggal) MAXID
    from tester.dataku group by nama)ns
    inner join tester.dataku on (dataku.tanggal=ns.MAXID and dataku.nama=ns.nama)
    I develop from your query to my table.

  • @pujanparvadia4356
    @pujanparvadia4356 2 ปีที่แล้ว +1

    What if I want to see orders processed after 2012? Can I just use Where ns.OrderDate>='2012-01-01'?

    • @accessibleitsoftwaretutori2488
      @accessibleitsoftwaretutori2488  2 ปีที่แล้ว

      Hi. No, you couldn't use ns.OrderDate because that column does not exist in the ns nested select. You need to add your where clause at the bottom, below the inner joins, and say where soh.OrderDate >= '01 Jan 2012'.