Hi, Is there a way I can add a field that gets incremented for each record in the query? For example, I have 2 tables with 2 names each that I want to join. Table1NameANameB Table2NameCNameD I want to to be able to add a counter to each one so I can join on that number and get: Table1Table2NameANameCNameBNameDIn MySQL I would use a variable to add a count to each of the tables then join on that number: set @lineTable1:=0;set @lineTable2:=0;select tab1.table1, tab2.table2from (select table1, @lineTable1:=@lineTable1+1 as number from table1) tab1Join (select table2, @lineTable2:=@lineTable2+1 as number from table2) tab2 on tab1.number = tab2.number[/code]However I can't seem to get this to work in JasperStudio. It looks like it's not possible to define a variable within the query. Does anyone know of a workaround?