422,363 Members | 2,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,363 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
1 Week Ago #1
Share this Question
Share on Google+
1 Reply

Expert Mod 10K+
P: 12,182
The ORDER BY clause has to come after the FROM clause.
1 Week Ago #2

Post your reply

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