I need to do a data conversation of 2 different tables

Asked

Viewed 32 times

0

good afternoon everyone, here me again to ask a question that for many is basic but I really don’t know how to do so come on. I have 2 tables originally in Paradox, I converted both to Firebird to try to facilitate the process, in fdb I have 2 tables, a call customers and another ctareceive in table 1(clients) I have the fields id, matricula, name, endreço, etc... in table 2(ctareceber) I have matricula, valorpago, emissao, datapagamento, etc.. but it doesn’t have the client’s name, it has his license plate, what I need is a select with the fields in table 2, however, with the field name of table 1 in place of the matricula in table 2, eg.

tab1
id matricula nome    endereco
1     1515   jose     rua das flores

tab2
id   matricula    emisao     vlrparcela   vencimento       pago
26    1515      30/01/2018      30,00        28/02/2019     0


eu preciso que fique assim:
tabx
id    matricula/nome    emissao   vlrparcela     vencimento     pago
26     jose           30/01/2019   30,00         28/02/2019      0 

Obs: I put in license plate/name because it doesn’t matter what name I get since I will only use it to convert clients' accounts to another database

2 answers

2

Good afternoon, I was able to solve with the help of Germano Buss Niehues, I made a small adjustment, I will leave Aki as I did so I can help other people with the same problem.

SELECT VENCIMENTO,CTARECEBER.ID,CTARECEBER.NUMERO,CTARECEBER.emissao,DATAPAGAMENTO,VALOR,VALORPAGO,clientes.NOME
FROM CTARECEBER
JOIN clientes ON ctareceber.matricula=clientes.matricula;

2

 SELECT id,nome,emissao,vlrparcela,vencimento,pago
    FROM tab1
    JOIN tab2 ON tab1.matricula=tab2.matricula;

thus?

  • I’ll try and get back to you with the result

  • SELECT NAME,MATURITY,ISSUANCE,DATE PAYMENT,VALUE,VALUE PAID FROM CTARECEBER JOIN ctareceber ON CUSTOMERS.matricula=ctareceber.matricula;

  • SELECT NAME,MATURITY,ISSUANCE,DATE PAYMENT,VALUE,PAYABLES FROM CTARECEBER JOIN ctareceber ON CUSTOMERS.matricula=ctareceber.matricula; gave error Column does not Belong to referenced table. Dynamic SQL Error. SQL error code = -206. Column Unknown. CLIENTS.MATRICULA. At line 3, column 29

Browser other questions tagged

You are not signed in. Login or sign up in order to post.