469,645 Members | 1,150 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

How to create table from a pre-existing table

I am developing a website on Laravel framework and I got a problem. I am in a situation where I need to retrieve only six most recent posts from a table named posts and those posts can be used individually and independently through their id. Copying from SQL Server, I tried the following code in phpMyadmin but it sends a Unexpected ordering of clauses. (near "order BY" )
The code:
Expand|Select|Wrap|Line Numbers
  1. SELECT title
  2. INTO tbl_recent_posts
  3. ORDER BY created_at DESC
  4. FROM posts;
Please guide me give me some ideas how can I do what I want to.
Thanks in advance
Apr 12 '18 #1
1 1919
12,516 Expert Mod 8TB
The ORDER BY clause has to come after the FROM clause.
Apr 13 '18 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Randell D. | last post: by
6 posts views Thread by Bruce | last post: by
12 posts views Thread by GCM | last post: by
2 posts views Thread by miladhatam | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.