-
Notifications
You must be signed in to change notification settings - Fork 20
date datetime helper #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
date datetime helper #25
Conversation
Forked Updated | Div arithmetic helper added
|
Hello Umer, this.$expr = new SQLBuilder.SQLPredefined.StringValueParam(sql);
this.$format = new SQLBuilder.SQLPredefined.StringValueParam(sql);You only need to to declare them if your syntax has used them like: |
|
Yes, I have removed the extra code which is not used in the helper. PR is
updated. Thanks
Regards,
Umer Mehmood
NorthBay
Direct: +92 3234971359
umer.mahmood@northbaysolutions.net <faheem.khan@northbaysolutions.net>
www.Northbaysolutions.com <http://www.northbaysolutions.com/>
…On Mon, Nov 11, 2019 at 8:23 PM Planetary Development < ***@***.***> wrote:
Hello Umer,
thanks for this new helper. It looks good to me.
Please remove the lines that we dont need.
this.$expr = new SQLBuilder.SQLPredefined.StringValueParam(sql);this.$format = new SQLBuilder.SQLPredefined.StringValueParam(sql);
You only need to to declare them if your syntax has used them like:
this.Types({
String: { syntax: this.Syntax('DATE(<value-param>, $expr[, $format])') },
});
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#25?email_source=notifications&email_token=AMMDKPBSWQG24B5CNGUKFSLQTF2G7A5CNFSM4JLWWO5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDXE5YA#issuecomment-552488672>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMMDKPDT6JMYFFUC5YA4MCLQTF2G7ANCNFSM4JLWWO5A>
.
|
|
THANKS! |
|
Hello,
I have a use case in which we want to use $count operator on a column value
and compare the result to any numeric value. And i am not able to use
$where helper to accommodate the $count helper.
E.g.
Select * from table1
Where count(column) = 10
…On Mon, 11 Nov 2019, 8:35 pm Planetary Development, < ***@***.***> wrote:
Merged #25 <#25>
into master.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#25?email_source=notifications&email_token=AMMDKPBPCDOLBPFEV7CFUILQTF3VNA5CNFSM4JLWWO5KYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOUYZPTPA#event-2788358588>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMMDKPG635LBTRA2KBGWJE3QTF3VNANCNFSM4JLWWO5A>
.
|
|
In addition to this, if i want to cast any column type while using it in
where.
E.g.
Select * from table1
Where cast(date) = '2019-09-01'
Also i have to cater this kind of use case.
On Mon, 11 Nov 2019, 9:16 pm umer mahmood, <
umer.mahmood@northbaysolutions.net> wrote:
… Hello,
I have a use case in which we want to use $count operator on a column
value and compare the result to any numeric value. And i am not able to use
$where helper to accommodate the $count helper.
E.g.
Select * from table1
Where count(column) = 10
On Mon, 11 Nov 2019, 8:35 pm Planetary Development, <
***@***.***> wrote:
> Merged #25 <#25>
> into master.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#25?email_source=notifications&email_token=AMMDKPBPCDOLBPFEV7CFUILQTF3VNA5CNFSM4JLWWO5KYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOUYZPTPA#event-2788358588>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AMMDKPG635LBTRA2KBGWJE3QTF3VNANCNFSM4JLWWO5A>
> .
>
|
|
One thing ahead - please open an new issue for further questions. So anybody can find if he got the same problem/question. Using the count-function inside the where clause will be a little bit tricky. You have to use the sql.build({
$select: {
$from: 'people',
$where: {
$and: [
{ $anyExpr: { $count: '*', $eq: 10 } }
]
}
}
});https://github.com/planetarydev/json-sql-builder2/tree/master/sql/helpers/misc/anyExpr |
|
I have opened an new issue #26 |
No description provided.