-6

I have the database as below picture shown:

enter image description here

I want to get the numbers under "ID" colm with "0" value in "is_parent".

How to do that with a sql query?

I want the numbers going to be link this:

1792,2304,1793,1794,2308.. etc..

Tried my best, with failed attempt, hopefully someone can help me with the correct query.

Thank you, regards.

Junius L
  • 15,881
  • 6
  • 52
  • 96
mza box
  • 67
  • 1
  • 3
  • 12
  • 1
    Possible duplicate of [How to get data from database and echo on php page?](http://stackoverflow.com/questions/19489439/how-to-get-data-from-database-and-echo-on-php-page) – coderodour May 19 '17 at 20:48
  • 5
    Can you please update your question and show us your best attempt at solving this problem yourself? – devlin carnate May 19 '17 at 20:49

2 Answers2

0

Try this, it is simple

SELECT id FROM `table_name` WHERE is_parent= 0
Ramana V V K
  • 1,245
  • 15
  • 24
0

well, if

SELECT id FROM `table_name` WHERE is_parent= 0

fails, you may try:

SELECT id FROM `table_name` WHERE is_parent IN (1792,2304,1793,1794,2308....)

or:

SELECT id FROM `table_name` WHERE is_parent != 0
josliber
  • 43,891
  • 12
  • 98
  • 133
f b
  • 115
  • 10