1

I have a two table

feedback_1  
questions

feedback_1 contains Columns

id ,patient_id,date_time,2,3,4,5,6,7,8,9,10

questions table contains row like

2

3

4

5

6

7

8

9

10

I have to join the feedback_1 table and questions like this

feedback_1 questions

2 2

3 3

4 4

5 5

6 6

7 7

8 8

  • Please share structure, sample data of both the tables and also state expected result... which DBMS are you using : SQL Server, Oracle? – Deep Nov 13 '14 at 04:59
  • If you are using Oracle then this might be useful http://stackoverflow.com/q/4841718/3898076 – Naman Gala Nov 13 '14 at 05:04

2 Answers2

0

This will might help you

SELECT 
    id , patient_id,date_time
FROM
    feedback_1 AS F
    INNER JOIN questions AS Q on q.id = f.id
Hardik Parmar
  • 1,053
  • 3
  • 15
  • 39
0

You can you natural join to avoid duplicate columns and rows

SELECT *  
FROM feedback_1
NATURAL JOIN questions 
King of kings
  • 695
  • 2
  • 6
  • 21