I’m writing a SQL embedded in C program with tables below:
table index:id, xx
table a:id, year, yy
table b:id, year, zz
table c:id, year, vv
id in a,b,c belong to id in index
Then how to select all the id order by year?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You question is not very clear about what you are after. Superficially, one possible answer might be:
If all of tables A, B, and C join to a single row in Index, then there are alternative queries (using more joins, possibly some of them being LEFT OUTER JOIN). If the columns represented by
yy,zzandvvare not compatible, then you need to specify what to do with them (or simply leave them out of the query).