Posts

Showing posts from February, 2025

Join

 SQL JOIN ka use do tables ke records ko join karne ke liye hota hai common column ke basis par. Aapke options hain: INNER JOIN LEFT JOIN RIGHT JOIN FULL JOIN 1️⃣ INNER JOIN (Common Records) 👉 Ye sirf matching records ko return karta hai jo dono tables me available hote hain. 🔹 Non-matching records include nahi hote. Example sql Copy code SELECT PO.PurchaseOrderID, GR.GoodsReceiptID FROM PurchaseOrder_TDI PO INNER JOIN GoodsReceipt_TDI GR ON PO.PurchaseOrderID = GR.PurchaseOrderID; Diagram yaml Copy code PurchaseOrder_TDI GoodsReceipt_TDI +------------+ +------------+ | PO_ID | | GR_ID | | 1001 |---✓---->| 1001 | | 1002 |---✓---->| 1002 | | 1003 | | 1004 | +------------+ +------------+ ✅ Result: PO_ID GR_ID 1001 1001 1002 1002 2️⃣ LEFT JOIN (All Left + Matching Right) 👉 Left table ke saare records + Right table ke sirf matching records ....