Welcome Guest, Not a member yet? Register   Sign In
select value that is not null
#1

[eluser]rochellecanale[/eluser]
hey guys i have a data like this in my table:

username| downline
sample1 | 2
sample2 | 3
sample3 | null
sample4 | null
sample5 | null

this is an output from my left join. Now all i want is to select only the user where the downline is not null.
so it means that i want show sample1 and sample2 from my view. I tried to use the != null but it gaves me 0. Can you help me guys?
#2

[eluser]NikosV[/eluser]
can we see your query code (including the !=null attempt)?
#3

[eluser]rochellecanale[/eluser]
Ok i just answered my own question a while ago. I just need to replace the left join with right join. Thanks for the response.
#4

[eluser]Sanjay Sarvaiya[/eluser]
Hello,

I think you can do in same SQL Query with the help of
Code:
downline IS NOT NULL
. no need to right join.
#5

[eluser]greenju[/eluser]
You can also use :
Code:
$this->db->where('downline IS NOT NULL','',false);
#6

[eluser]rochellecanale[/eluser]
thanks...




Theme © iAndrew 2016 - Forum software by © MyBB