Wednesday, 15 May 2013

mysql - How to Filter INNER JOIN SQL Command Results -


I have a table that forms the form submissions, the following variables are for each submission of the form: < Pre> userid record accountant account number

When a user submits the form, the table is populated by one record values ​​on each line item In, these values ​​are generally associated with the record value I userid , accountName And displaying accountNumber and username for trying to filter the results on a table by user INNER JOIN As I am very close to this command:

  SELECT t1.value as number, t2.value as name, t3.value as userid from mytable AS t1 INNER mytable Insert t3 INNER mytable As t2 ON t1.record = t2.record WHERE t1.name = 'addAccountNumber' and t2.name = 'addAccountName' and t3.name = 'userid'   

The only problem is that The result is not limited to one copy per entry There are only It appears that many examples are being shown in the table.

I believe that some edits should be done around the WHERE part of the statement. It seems that the results are not being named on the names and the results are filtering. Any suggestions about how to solve this?


Updated:

I should add that I get the proper filtering results when I include only two lines in the call as seen here:

  Select t1.value as accountNumber, t2.value as mytable AS t1 Join INNER as mytable on T2 on T1. TCR = t2.record WHERE t1.name = 'addAccountNumber' and t2 .name = 'addAccountName'   

I think it is possible to show who I am coming from. Therefore, in general this userid variable which is causing me trouble

I have a hard time understanding what you want, but it may happen.

  SELECT t1.value as number, t2.value as name, t3.value AS USIDEd from iTable to T1 inner INEER MENTABLE AS T3 ON T1 ON T1. TCR = T3. RECN inner MANTABLE ATT2 ON T 1.RCRDC = T2 Records WHEE T1 Name = 'adacquin number' and t2 Name = 'ad account nm' and 't3 .name =' userid '   

No comments:

Post a Comment