Skip to content

Invoke-SqlQuery returns only records that have a unique key #146

Closed
@kwein123

Description

@kwein123

The following set of SELECT queries should each return 77 rows since there is no WHERE clause in any of the queries. Yet you can see that I get a different number of records back depending on the list of fields I am selecting, as though there was an implicit " | Unique" at the end of the line:

PS V:\Publish\KWeinrich\Storage> (invoke-sqlquery "SELECT * FROM JunctionPointTargets").count  
77
PS V:\Publish\KWeinrich\Storage> (invoke-sqlquery "SELECT Server FROM JunctionPointTargets").count
12
PS V:\Publish\KWeinrich\Storage> (invoke-sqlquery "SELECT Server,Share FROM JunctionPointTargets").count
20
PS V:\Publish\KWeinrich\Storage> (invoke-sqlquery "SELECT Server,Share,DirectoryName FROM JunctionPointTargets").count
77

This table has an index of "Server, Share, DirectoryName, FileName" - but that shouldn't matter for how many rows the above queries return. But there are only 12 unique servers, and only 20 unique Server/Share combinations.

Note: All queries return 77 records, as expected, when run in SQLyog.
(I am running the queries against a MySQL 8.0.36 server, using SimplySql 2.0.2.70, Open-MySqlConnection)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions