Below is my query:
%psql.sql
select text from delta limit 5;
Is it possible to display text as the link in Zeppelin?
Try transform your text column, like
%html [TEXT]
Take a look http://zeppelin.apache.org/docs/0.7.2/displaysystem/basicdisplaysystem.html#table for more information.
Related
I have a report which is just one page per record. The record is chosen using a parameter.
On this report I have space for 4 images, I have a dataset called "AdditionalPhotos". I would like to put the image from the first four rows of this dataset into each of the spaces on the report.
To do this, I planned on using an expression with a function like : First(Image), Second(Image), Third(Image), Fourth(Image). I now realise that SSRS only supports First() and Last() so using some advice from another forum post : http://social.msdn.microsoft.com/Forums/sqlserver/en-US/20493945-578a-4d83-ae3b-e603a3473ac6/nth-row-element-in-a-dataset-ssrs
I have implemented another dataset which contains the same query as the "AdditionalPhotos" but with only 2 columns "ID" and "RowNum". Using this expression I can see a Photo Source field in a textbox, which is great, so the syntax is working.
=Lookup(1,Fields!Row.Value,Fields!Source.Value, "AdditionalPhotos")
In the value field for the image I have :
=Lookup(1,Fields!Row.Value,Fields!Image.Value, "AdditionalPhotos")
This doesn't work, I just get a red x icon in the image box of the report. I have the correct MIME type setting and have confirmed this by changing the expression for the image box to :
=Fields!Image.Value
Any advice or suggestions would be great.
In your SQL you can use the ROW_NUMBER() window function to generate row numbers based on an order and/or a partition so that you can select which image you want where.
Something like:
SELECT Image,
ROW_NUMBER() OVER(ORDER BY id) AS rownum
FROM imageTable
See:
MSDN - ROW_NUMBER (TSQL)
MSDN - OVER Clause
In cassandra how to add images in column family for a row. Below I mentioned a sample table which shows the KEY,Name,Age and Cover_Image.
Here we can able to add Name,Age by entering the queries like this
create column family users with comparator=UTF8Type
and column_metadata=[
{column_name:Name,validation_class:UTF8Type},
{column_name:Age,validation_class:LongType,index_type:KEYS}];
set users[babu][Name]='Babu Droid';
set users[babu][Age]=23;
Like the above queries, what's the query to add an image (query for both create(also validation_class) and set options)
For an image you would want to use BytesType for the column validator and simply insert the raw bytes of the image into the column. There won't be a good way to do something like that from the command line interface though. You would need to write some custom code using a client library.
in my sqlite database, a table named image contains three fields label, url and index.
I wrote the following piece of code for fetching data from database: "SELECT DISTINCT(label), index from image;". In my table there is a label 'Cat' 3 times. According to this code the code must show only one 'Cat' from my database. But it won't working. It fetches all three 'Cat' label. Why it happens? please help me to find a possible solution. index field is different for all three 'Cat' labels.
The DISTINCT keyword is not a function, it specifies that duplicate rows should be removed from the results:
If the simple SELECT is a SELECT DISTINCT, then duplicate rows are
removed from the set of result rows before it is returned
What you are trying to accomplish probably requires you to group by label:
SELECT label, index FROM image GROUP BY label
Try this:
select label, index from image
where label in (select distinct label from image)
is there an easy way to get a list of all columns of a SQL query?
They are listed in the header of the results window of SSMS but I can't copy them.
Thanks in advance.
EDIT:
sorry, I found it myself after a little googling:
http://vidmar.net/weblog/archive/2008/06/05/save-sql-query-results-with-column-names-in-msssms.aspx
Go to Query -> Query Options and check the following box
If you change to Results To Text, then you can copy them.
To save actually executing the full query just to get the column names, you could also do:
SET FMTONLY ON;
SELECT * FROM SomeTable;
This will just return the metadata about the columns the query returns. Saves waiting around if the query is meaty.
Change the result window to 'Results to text' instead of 'Results to grid'.
This can be done by clicking of the on of the Icons above the query window. It looks somewhat like a notepad icon.
I have a table in SQL Server with the following columns:
id int (primary key)
text nvarchar(max) (full text indexed)
type int
and I have queries like this:
where Contains([text], #text)
or
where Contains([text], #text) AND [type] = 3
However the second query is slow. I think I should integrate full text index with [type] field.
Is there another solution?
Thanks
I'm assuming you're not running SQL 2008, as the integrated full text engine in that version should make better decisions for a query such as yours. For earlier versions, I've had success by embedding additional keys in the text with some form of a custom tag. You'll need some triggers to keep the text up to date with the keys.
e.g., "This is my sample text.
TypeKey_3"
Then your where clause becomes something like:
where Contains([text], #text AND "TypeKey_" + #type)
Given that you cannot add an integer field to a full text index your best bet is to add a regular index to [type].