By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,902 Members | 1,268 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,902 IT Pros & Developers. It's quick & easy.

How to create table from a pre-existing table

P: 12
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
Share this Question
Share on Google+
1 Reply

Expert Mod 10K+
P: 12,359
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.