If you specify the file within the QRYFILE parameter on the RUNQRY command then you have to define the member that you want to use. The default value is *FIRST which will pick up the first created member in the file.
If you are only specifying the QRY parameter on the RUNQRY command then the file used will be that defined in the query definition, again the member name is picked up at definition time and defaults to *FIRST.
As an aside, one other thing to be aware of when defining files in queries is that if during the query creation you specify *LIBL as the library name, the system will replace *LIBL with the name of the library in the library list containing the file. When you later run the query, the query will look for that occurrence of the file, and not the version in the library list.
This is usually of concern where you develop a query over, say, FILEA in DEVDTALIB and then try to run the query over a production library list that has FILEA in PRDDTALIB. Unless the QRYFILE(*LIBL/FILEA) is specified on the RUNQRY command the data returned will be from DEVDTALIB.
All the best