Skip to content
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

Error SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "as" #871

Closed
Abdulhmid opened this issue Dec 2, 2016 · 3 comments
Closed
Labels

Comments

@Abdulhmid
Copy link

Summary of problem or feature request

Code snippet of problem

System details

  • Operating System
  • PHP Version
  • Laravel Version
  • Laravel-Datatables Version
@efriandika
Copy link

efriandika commented Dec 4, 2016

I got same error

DB: PostgreSQL. It worked when I still used v6.22.0. It will not work in > v6.22.0

QueryException in Connection.php line 729: 

SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "as"
LINE 1: ...st"."created_by" where (LOWER("post"."CAST(title" as "TEXT)"...
^ (SQL: select count(*) as aggregate from (select row_number() OVER (ORDER BY publish_date_start DESC) AS rownum, "post".*, "post_category"."name" as "category_name", "post_channel"."name" as "channel_name", "users"."name" from "post" inner join "post_category" on "post_category"."id" = "post"."post_category_id" inner join "post_channel" on "post_channel"."id" = "post_category"."post_channel_id" inner join "users" on "users"."id" = "post"."created_by" where (LOWER("post"."CAST(title" as "TEXT)") LIKE %b% or LOWER("CAST(users"."name" as "TEXT)") LIKE %b%) and "post"."deleted_at" is null and "post"."deleted_at" is null order by "publish_date_start" desc) count_row_table)

@yajra
Copy link
Owner

yajra commented Dec 4, 2016

Thanks for reporting. I think this might be connected to PR #849. I haven't used PostgreSQL so if someone can please submit a PR for a possible fix? Will try to setup a postrgeSQL app when I had the chance. Sorry for the inconvenience.

@yajra
Copy link
Owner

yajra commented Dec 6, 2016

Guys, can you please check if the PR above fixes this issue? Thanks!

@yajra yajra closed this as completed in 1622a77 Dec 7, 2016
yajra added a commit that referenced this issue Dec 7, 2016
@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants