0

I am trying to fetch specific columns from a table using phpmyadmin but it gives me sytanx error

my statement:

SELECT * FROM `node_revisions` WHERE `nid` =4,5,8,20; 

2 Answers 2

1

You mean specific rows (not columns). You have to use in:

SELECT * FROM `node_revisions` WHERE `nid` in (4,5,8,20); 

or AND concatinated where clause:

SELECT * FROM `node_revisions` WHERE `nid` =4 AND `nid` =5 AND `nid` =8 AND `nid` =20; 
Sign up to request clarification or add additional context in comments.

1 Comment

Fast as lightning hehe :)
0

You probably meant to write:

SELECT * FROM `node_revisions` WHERE `nid` in (4,5,8,20); 

Does this help?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.