1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Select between 2 tables

Discussion in 'MySQL' started by danielldf, May 26, 2016.

  1. #1
    database:
    agencia (nome_agencia, cidade_agencia, fundos)
    cliente (nome_cliente, rua_cliente, cidade_cliente)
    conta (nome_agencia, numero_conta, saldo)
    emprestimo (nome_agencia, numero_emprestimo,total)
    depositante (nome_cliente, numero_conta)
    devedor (nome_cliente, numero_emprestimo)
    SEMrush
    SELECT rua_cliente, numero_conta FROM cliente, conta WHERE rua_cliente LIKE '%Rua a%', conta.numero_conta;

    This select would show results from column "rua_cliente" having "Rua a" and its "numero_conta" related results?
     
    danielldf, May 26, 2016 IP
    SEMrush
  2. sarahk

    sarahk iTamer Staff

    Messages:
    24,049
    Likes Received:
    3,239
    Best Answers:
    92
    Trophy Points:
    615
    #2
    I'm not quite sure what you are after - is it just that you need to know how many contact records there are for each client
     
    sarahk, May 26, 2016 IP
  3. jestep

    jestep Prominent Member Premium Member

    Messages:
    3,634
    Likes Received:
    212
    Best Answers:
    18
    Trophy Points:
    330
    #3
    Unless the cliente and conta tables themselves have a relationship (basically a column that link them together, either directly or through other tables), there isn't a good way to do this.
     
    jestep, Jun 2, 2016 IP