DQL to remove a subgroup from a group in Documentum? - dql

Does anyone know how to remove a subgroup from a group in Documentum using DQL?
Thanks

ALTER GROUP group_name DROP members
screenshot from DQL Reference Manual:

Related

Cant navigate into a specific column sqlite

The first link is the problems.
I am very inexperienced in SQLite and needed some help.
Thanks in advance!
https://imgur.com/v7BdVe3
These are all the tables displayed open
https://imgur.com/a/VMOxAuc
https://imgur.com/a/LrDcCBQ
The schema
https://imgur.com/a/bv5KTHN
This is as far as I could get which is close but I couldn't figure out how to sort it also by marina 1.
SELECT BOAT_NAME, OWNER.OWNER_NUM, LAST_NAME, FIRST_NAME from OWNER inner join MARINA_SLIP on OWNER.OWNER_NUM = MARINA_SLIP.OWNER_NUM;
If you know anything else bout the other questions feel free to help me with those too, Thanks!
I believe that you want
SELECT BOAT_NAME, OWNER.OWNER_NUM, LAST_NAME, FIRST_NAME
FROM OWNER INNER JOIN MARINA_SLIP ON OWNER.OWNER_NUM = MARINA_SLIP.OWNER_NUM
WHERE MARINA_NUM = 1
ORDER BY BOAT_NAME;
The second question involves multiple joins.
The third question asks you to use the count(*) function, noting that this is an aggregate function and will result in the number of rows for the GROUP as per the GROUP BY clause (if no GROUP BY clause then there is just the one GROUP i.e. all resultant rows).
The fourth question progresses a little further asking you to extend the GROUP BY clause with the HAVING clause (see link above for GROUP BY).

Doctrine 1.2: how to get the count of related table rows ina a query?

I have a table of users, plus a related table called UserWorkplaces, where one user could have any number of related rows on the UserWorkplaces table.
I'm trying to build a query to find all of the users with only one related row in UserWorkplaces. What kind of query should I use to get this?
Here's what I've tried so far, but it gave me the count of everyone's workplaces and only a single user:
$query = Doctrine_Query::create()
->from('Users', 'u')
->innerJoin('u.userWorkplaces uw')
->having('COUNT(uw.id) = 1');
I believe your problem is not Doctrine but the SQL you wanna achieve.
Make the story short, following code should work you.
$query = Doctrine_Query::create()
->from('Users u')
->innerJoin('u.userWorkplaces uw')
->having('COUNT(uw.id) = ?', 1)
->groupBy('u.id');
COUNT() is aggregate function and therefore you need to specify the GROUP BY parameter for the main table you want to list in.

Order by Sum Field

I try to write a SQL-Statement in X++. It should do something like this:
SELECT
Table.field1, SUM(Table.field2) AS SumField
FROM
Table
WHERE
Table.FieldX = Something
GROUP BY
Table.Field1
ORDER BY
SumField;
The problem i have in X++ is that it orders the records before calculating the sum of them. I know that i could make a While Select in X++ and order them by code, but that is not the way i want to do it.
Can someone tell me how i could handle this?
Sorry, but you cannot both do a sort by and group by in a X++ select or query.
The solution is to make a view (without the sort), then do a select on the view with the order by.

how to query those data ,which apper more than twice in table?

I would like to query customer from order table and only customer order more than twice is qualifed.
Which clause or filter should I use to filter those customer order more than twice ?
Please help
I am using SQLite.
Best regards
tom
SELECT customer_id FROM orders GROUP BY customer_id HAVING count(*) > 2;
In the future, please provide more information such as Table definition or you'll probably get a few downvotes :)

Convert linq query with having

i fail while converting this sql to linq...
hope anybody do it.
SELECT Max([PersonalNumber]+1)
FROM TestTable
GROUP BY CalYear
HAVING CalYear=Year(Now())
Thanks.
The HAVING clause is there to enable you to filter on the results of an AGGREGATE. In this instance you are filtering on the GROUP column which could just be filtered using a WHERE clause instead.
Therefore you do not need to produce a HAVING clause in LINQ. A simple WHERE clause will do the same.
check out here --> http://blogs.msdn.com/vbteam/archive/2007/12/18/converting-sql-to-linq-part-5-group-by-and-having-bill-horst.aspx
From TestTable in a
Group By CalYear
into CalYear = Year(Now())

Resources