Changes between Initial Version and Version 3 of Ticket #29976


Ignore:
Timestamp:
Nov 22, 2018, 7:31:23 AM (5 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29976

    • Property Severity Release blockerNormal
    • Property Resolutioninvalid
    • Property Status newclosed
  • Ticket #29976 – Description

    initial v3  
    1 I have two models like this
     1I have two models like this:
     2{{{
    23class Story(models.Model):
    34    name = models.TextField(db_column='NAME')  # Field name made lowercase.
     
    89    status = models.TextField(db_column='STATUS')  # Field name made lowercase.
    910       
    10 
     11}}}
    1112I would like to get count of Unique status from above two tables
    1213
    13 Query: Select new_table.status, Count(new_table.name) from (select status, name from Story Union select status, name from Bug) new_table group by new_table.status
     14Query: `Select new_table.status, Count(new_table.name) from (select status, name from Story Union select status, name from Bug) new_table group by new_table.status`
Back to Top