Hello all,
I'm having trouble on a select statement I'm executing with two tables. Basically I'm trying to count how many instances an id number appears in a table. The first and most important query I need to execute to do this looks like this:
I end up getting this error:
I've never run into this kind of error before. Can someone please tell me what's going on?
Thanks,
Jisoo22
I'm having trouble on a select statement I'm executing with two tables. Basically I'm trying to count how many instances an id number appears in a table. The first and most important query I need to execute to do this looks like this:
Code:
$session_part_query = pg_Query($conn, "SELECT DISTINCT t0.part_id FROM sess_panelists t0, participants t1
WHERE (t0.part_id = t1.part_id) ORDER BY t1.part_last ASC");
I end up getting this error:
Code:
pg_query() query failed: ERROR: For SELECT DISTINCT, ORDER BY expressions must appear in target list in ... line 45
I've never run into this kind of error before. Can someone please tell me what's going on?
Thanks,
Jisoo22