I've a table I'm calling recursively.

CREATE TABLE "staff" ( `id` TEXT, `logonName` TEXT, `firstname` TEXT,
`surname` TEXT, `departmentId` TEXT, `managerId` TEXT,
`holidayDaysEntitlement` INTEGER, `holidayDaysTaken` REAL, PRIMARY
KEY(`id`) )

managerId points to the same table, so my join is simply:

select * from staff
inner join departments on staff.departmentId=departments.id
inner join staff as managers on staff.managerId=managers.id

This works fine using DB Browser for SQLite, and adding WHERE clauses like '
managers.id='1' ' etc.  (apologies for wrapping that in quotes...)

Anyway.  Using system.data.sqlite.dll in vb.net, only the field names are
returned.  Using this statement doesn't work:
dim s1 as string=sqlReader("managers.firstname").ToString

Retrieving the 12th field, gives me just 'firstname'
 MsgBox(sqlReader.GetName(11))

I know I can change my SQL statement to be explicit, and select each
required field and use AS, but is that the only solution?


Thanks,
Chris
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to