-1

I have two tables A and B. A has columns a,b,c,d,e,f and B has columns a and g. How can I get the row from table A according to the value of 'a' from Table B?

  • 1
    You can try this query "SELECT * FROM B LEFT JOIN A on A.a = B.a WHERE B.a = yourinput" – Arshad Feb 27 '18 at 07:30
  • 2
    Possible duplicate of [SQL JOIN and different types of JOINs](https://stackoverflow.com/questions/17946221/sql-join-and-different-types-of-joins) – Vishnu Bhadoriya Feb 27 '18 at 07:46

2 Answers2

2

Try simple join query

Select A.a From A inner join B on A.a=B.a

if need extra condition

Select A.a From A inner join B on A.a=B.a where B.a=?
Mr.No
  • 83
  • 9
MJM
  • 5,119
  • 5
  • 27
  • 53
0

Try this:

SELECT a.a, a.b, a.c, a.d, a.e, a.f, b.g
FROM A a,
INNER JOIN B b ON a.a = b.a
WHERE a.a = b.a

These are the basics of SQL, next time try to read up on the basics first. You can go here W3SCOOLS if you want to learn.

Levidoom
  • 74
  • 1
  • 11