>> And here is a new corner-case:
>>
>> - "SELECT 1 FROM ..." Some databases cannot handle unnamed columns in
>> subqueries. E.g. SQL Server can't run SELECT count(*) FROM (SELECT 1).
>> It would have to be changed to SELECT count(*) FROM (SELECT 1 [dummy])
>
>
> I've never worked with SQLServer and have none at hand to test this, but
> would COUNT(1) make it work in this case?
No, this is a general syntax "issue" in SQL Server. This query here:
select * from (select 1, 2) t
Causes the same issue. In this case, solutions would be any of these:
-- Renaming columns in the subquery
select * from (select 1 a, 2 b) t
-- Using derived column lists
select * from (select 1, 2) t(a, b)
This corner-case isn't really related to the COUNT(*) operation but to
unnamed columns in subqueries:
https://github.com/jOOQ/jOOQ/issues/579
jOOQ already auto-generates the missing table name [t] in the above
example, as providing names for derived tables is required by many
databases (e.g. including MySQL, SQL Server). With jOOQ 3.0's support
for derived column lists, #579 can finally be fixed also for SQL
Server
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.