Foros del Web » Programando para Internet » PHP »

porque me sale mal el distinct

Estas en el tema de porque me sale mal el distinct en el foro de PHP en Foros del Web. No entiendo porque me sale mal, me podeis ayudar porfavor? Gracias Código PHP: $select_ofertas_3 = mssql_query ( "select distinct fam_codi from familias where fam_codi = '$select_ofertas_2_a[fam_codi]'" ); ...
  #1 (permalink)  
Antiguo 09/03/2010, 03:01
 
Fecha de Ingreso: marzo-2009
Mensajes: 480
Antigüedad: 15 años
Puntos: 1
porque me sale mal el distinct

No entiendo porque me sale mal, me podeis ayudar porfavor?

Gracias

Código PHP:
$select_ofertas_3=mssql_query("select distinct fam_codi from familias where fam_codi = '$select_ofertas_2_a[fam_codi]'"); 
  #2 (permalink)  
Antiguo 09/03/2010, 03:22
 
Fecha de Ingreso: septiembre-2004
Mensajes: 324
Antigüedad: 19 años, 7 meses
Puntos: 13
Respuesta: porque me sale mal el distinct

que devuelve mysql_error()?

Prueba con la sintaxis de aqui
http://sql.1keydata.com/es/sql-distinct.php

De todas formas esto no lo tengo muy claro yo
'$select_ofertas_2_a[fam_codi]'
  #3 (permalink)  
Antiguo 09/03/2010, 03:30
 
Fecha de Ingreso: marzo-2009
Mensajes: 480
Antigüedad: 15 años
Puntos: 1
Respuesta: porque me sale mal el distinct

ya lo he arreglado

Código PHP:
$select_ofertas_3=mssql_query("select * from familias where fam_codi in (select fam_codi from articulo where art_codi in (select art_codi from ofertas where cli_codi = '0001' and (ofe_inicio <= '$tiempo_hoy1') and (ofe_fin >= '$tiempo_hoy1')))"); 

Etiquetas: distinct, mal, sale
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:28.