MySQL + SQL · Lesson 67

MySQL में INNER JOIN

INNER JOIN

INNER JOIN सिर्फ वे rows लौटाता है जिनका दोनों tables में match हो। बिना match वाली rows छोड़ दी जाती हैं।

Example

SELECT s.name, c.class_name
FROM students s
INNER JOIN classes c ON s.class_id = c.class_id;
जिस student की class_id का matching class नहीं, वह नहीं दिखता।

Table Aliases

students s table को छोटा alias s देता है, तो students.name की जगह s.name लिखते हैं।

सारांश

  • INNER JOIN = सिर्फ दोनों tables में matching rows।
  • matching condition के लिए ON use करें; aliases queries छोटी करते हैं।
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

💻 लाइव कोड एडिटर

इस पेज के प्रोग्राम यहीं तैयार हैं — चलाएँ, बदलें और सीखें। कुछ भी इंस्टॉल किए बिना।
OneCompiler द्वारा संचालित। कोड एडिटर में अपने आप आ जाता है — Run दबाकर आउटपुट देखें। अगर एडिटर न खुले तो नए टैब में खोलें.