rows, err := db.Query("SELECT id,type,name FROM auto WHERE status=1")
checkErr(err)
defer rows.Close()
for rows.Next() {
var id, type, id_type int
var name string
rows.Scan(&id, &type, &name)
db.QueryRow("SELECT id FROM type WHERE id=$1",type).Scan(&id_type)
.........
}